An example of a sequence diagram

The best way to learn anything is by looking at an example of it. Let's take a look at the following sequence diagram of a simple restaurant system:

Here, we can see that a customer first asks for the menu from the UI. The UI passes the request to the Controller and then the Controller passes the request to the Manager. The Manager gets the menu and responds to the Controller. The Controller responds to the UI and the UI displays the menu in the display.

After the Customer chooses an item, the order goes step by step to the Manager. The Manager calls another method to prepare the food and sends a response to the Customer notifying them that the order has been received. When the food is ready, it is served to the Customer. Upon receiving the food, the Customer pays the bill and collects a Payment Receipt.

By looking at the sequence diagram, we can see the different activities involved in the process. It's pretty clear how the system is working step by step. This kind of diagram is very useful in showing the flow of a system, and is very popular.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.116.21.239