Use Case Diagram for Facebook

Learn how to define use cases and create the corresponding use case diagram for the Facebook problem.

Let's begin building the use case diagram of Facebook and understand the relationship between its different components.

First, we are going to define the different elements of our Facebook system, followed by the complete use case diagram of the system.

System

Our system is "Facebook."

Actors

Now, we’ll define the main actors of Facebook.

Primary actors

  • User: This actor can create a profile of themselves containing their personal information. They can create posts, pages, and groups, and add various sorts of multimedia like images or videos. They can also interact with other users by sending them friend requests and messages, commenting on their posts, etc.

Secondary actors

  • Page/Group Admin: The admin is in charge of performing numerous operations, including blocking or unblocking users from groups or pages, deleting an existing group, changing the group’s privacy, etc.

  • System: This is responsible for sending out notifications for new friend requests, messages, comments, etc.

Use cases

In this section, we’ll define the use cases for Facebook. We have listed the use cases according to their respective interactions with a particular actor.

Note: You’ll see some use cases occurring multiple times because they are shared among different actors in the system.

User

  • Add/update profile: To add information like work, education, and places of visit details or to update an existing profile

  • Follow/unfollow user: To follow or unfollow other users

  • Send message: To send a message to other users

  • Send friend request: To send a friend request to other users

  • Create/like/follow/share page: To either create a new page or perform actions including liking, following, or sharing an existing page.

  • Create/join/leave group: To either create a new group or perform actions like joining or leaving an existing group

  • Invite users to group: To invite other users to an existing group.

  • Add/update/delete post: To add a new post, update the content of the post, or delete an existing post

  • Like/comment/share post: To like a post, comment on a post, or share a post

  • Add/update/delete/like comment: To add a new comment, update the content of the comment, like a particular comment, or delete a comment

  • Accept/reject friend request: To accept or reject a friend request from another user

  • Update privacy: To update the privacy settings of the profile

  • Search users/groups/pages/posts: To search for other users, any existing groups or pages, or any posts made by users

  • Accept/Reject friend request: To accept or reject a friend request from another Facebook user

  • Accept/Reject group join invitation: To accept or reject a group joining invitation from another Facebook user

  • Like/Comment/Share Post: To like, comment, or share any post visible to users on Facebook

Page/Group Admin

  • Block/unblock user: To block or unblock a user from a group or page

  • Enable/disable page: To enable or disable a page

  • Delete group: To delete an existing group

  • Change a group's privacy: To change the privacy settings of a group (from public to private and vice versa)

System

  • Send new friend request notification: To send a notification of any friend request sent by another user

  • Send message notification: To send a notification of any new messages

  • Send new post notification: To send a notification of any new posts

  • Send comment notification: To send a notification of any comments on your or others' posts

Relationships

We describe the relationships between and among actors and their use cases in this section.

Generalization

  • The “Page/Group Admin” has a generalization relationship with the “User” as the admin can perform all those tasks that a normal user can perform.

  • We can search for other users, groups, pages, or even posts. This shows that the “Search” use case has a generalization relationship with the “users,” “groups,” “pages,” and “posts” use cases.

Associations

The table below shows the association relationship between actors and their use cases.

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.