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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education