Sequence Diagram for Facebook
Visualize the sequence diagram for sending a friend request on Facebook.
We'll cover the following
Sequence diagrams are a great way to understand the interactions between different entities and objects in the system. There can be different sequence diagrams that we can create for Facebook. In this lesson, we will create sequence diagrams for the following interaction:
Send a friend request: A user sends a friend request to another user.
Send a friend request
The sequence diagram for sending a friend request should have the following actors and objects that will interact with each other:
Actors:
User A
andUser B
Objects:
Catalog
andFriendRequest
Here’re the steps for the “send a friend request” interaction:
User A searches for user B in the catalog.
If User B exists:
The catalog returns user B
User A adds user B as a friend.
The friend request is sent to user B.
If the request is accepted:
User B is added to user A's friend list.
User A gets a notification that the friend request has been accepted.
Else, the request is rejected.
Else, if user B does not exist:
User A receives a "user not found" error.
Based on the order above, the sequence diagram for sending a friend request on Facebook is given below: