Draw the follClass Structure:   1. NotificationSystem: This is the main class that manages the notification system. It has the following attributes and methods: - Attributes:   - users: a list of User objects representing all the users registered in the system   - tweets: a list of Tweet objects representing all the tweets posted in the system - Methods:   - register_user(user): adds a new user to the system   - post_tweet(user, message): posts a new tweet on behalf of a user   - get_timeline(user): returns a list of tweets from all users that the specified user follows   - get_mentions(user): returns a list of tweets that mention the specified user   2. User: This class represents a user in the system. It has the following attributes and methods: - Attributes:   - username: a string representing the username of the user   - followers: a list of User objects representing all users who follow this user   - following: a list of User objects representing all users whom this user follows - Methods:   - follow(user): adds another user to this user's following list and adds this user to that user's followers list   3. Tweet: This class represents a tweet in the system. It has the following attributes and methods: - Attributes:   - author: a User object representing the author of this tweet   - message: a string representing the content of this tweet - Methods:   None   Functions' Specification:   1. register_user(user) - Input: A User object representing the new user to be registered in the system. - Output: None. - Description: Adds a new user to the notification system.   2. post_tweet(user, message) - Input: A User object representing the author of this tweet, and a string representing its content. - Output: None. - Description: Posts a new tweet on behalf of an existing user.   3. get_timeline(user) - Input: A User object representing the user whose timeline is requested. - Output: A list of Tweet objects representing all the tweets from all users that the specified user follows. - Description: Returns a list of tweets from all users that the specified user follows.   4. get_mentions(user) - Input: A User object representing the user whose mentions are requested. - Output: A list of Tweet objects representing all the tweets that mention the specified user. - Description: Returns a list of tweets that mention the specified user.   5. follow(user1, user2) - Input: Two User objects representing the users involved in this action (user1 follows user2). - Output: None. - Description: Adds another user to this user's following list and adds this user to that other user's followers list.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

Draw the follClass Structure:

 

1. NotificationSystem: This is the main class that manages the notification system. It has the following attributes and methods:

- Attributes:

  - users: a list of User objects representing all the users registered in the system

  - tweets: a list of Tweet objects representing all the tweets posted in the system

- Methods:

  - register_user(user): adds a new user to the system

  - post_tweet(user, message): posts a new tweet on behalf of a user

  - get_timeline(user): returns a list of tweets from all users that the specified user follows

  - get_mentions(user): returns a list of tweets that mention the specified user

 

2. User: This class represents a user in the system. It has the following attributes and methods:

- Attributes:

  - username: a string representing the username of the user

  - followers: a list of User objects representing all users who follow this user

  - following: a list of User objects representing all users whom this user follows

- Methods:

  - follow(user): adds another user to this user's following list and adds this user to that user's followers list

 

3. Tweet: This class represents a tweet in the system. It has the following attributes and methods:

- Attributes:

  - author: a User object representing the author of this tweet

  - message: a string representing the content of this tweet

- Methods:

  None

 

Functions' Specification:

 

1. register_user(user)

- Input: A User object representing the new user to be registered in the system.

- Output: None.

- Description: Adds a new user to the notification system.

 

2. post_tweet(user, message)

- Input: A User object representing the author of this tweet, and a string representing its content.

- Output: None.

- Description: Posts a new tweet on behalf of an existing user.

 

3. get_timeline(user)

- Input: A User object representing the user whose timeline is requested.

- Output: A list of Tweet objects representing all the tweets from all users that the specified user follows.

- Description: Returns a list of tweets from all users that the specified user follows.

 

4. get_mentions(user)

- Input: A User object representing the user whose mentions are requested.

- Output: A list of Tweet objects representing all the tweets that mention the specified user.

- Description: Returns a list of tweets that mention the specified user.

 

5. follow(user1, user2)

- Input: Two User objects representing the users involved in this action (user1 follows user2).

- Output: None.

- Description: Adds another user to this user's following list and adds this user to that other user's followers list.

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Draw the following Class Structure as a (class digram):

 

1. NotificationSystem: This is the main class that manages the notification system. It has the following attributes and methods:

- Attributes:

  - users: a list of User objects representing all the users registered in the system

  - tweets: a list of Tweet objects representing all the tweets posted in the system

- Methods:

  - register_user(user): adds a new user to the system

  - post_tweet(user, message): posts a new tweet on behalf of a user

  - get_timeline(user): returns a list of tweets from all users that the specified user follows

  - get_mentions(user): returns a list of tweets that mention the specified user

 

2. User: This class represents a user in the system. It has the following attributes and methods:

- Attributes:

  - username: a string representing the username of the user

  - followers: a list of User objects representing all users who follow this user

  - following: a list of User objects representing all users whom this user follows

- Methods:

  - follow(user): adds another user to this user's following list and adds this user to that user's followers list

 

3. Tweet: This class represents a tweet in the system. It has the following attributes and methods:

- Attributes:

  - author: a User object representing the author of this tweet

  - message: a string representing the content of this tweet

- Methods:

  None

 

Functions' Specification:

 

1. register_user(user)

- Input: A User object representing the new user to be registered in the system.

- Output: None.

- Description: Adds a new user to the notification system.

 

2. post_tweet(user, message)

- Input: A User object representing the author of this tweet, and a string representing its content.

- Output: None.

- Description: Posts a new tweet on behalf of an existing user.

 

3. get_timeline(user)

- Input: A User object representing the user whose timeline is requested.

- Output: A list of Tweet objects representing all the tweets from all users that the specified user follows.

- Description: Returns a list of tweets from all users that the specified user follows.

 

4. get_mentions(user)

- Input: A User object representing the user whose mentions are requested.

- Output: A list of Tweet objects representing all the tweets that mention the specified user.

- Description: Returns a list of tweets that mention the specified user.

 

5. follow(user1, user2)

- Input: Two User objects representing the users involved in this action (user1 follows user2).

- Output: None.

- Description: Adds another user to this user's following list and adds this user to that other user's followers list.

 

 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Software Development
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,