Sequence Diagram for the Hotel Management System
Create a sequence diagram for online room booking in the hotel management system and solve a challenge.
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 our hotel management system. In this lesson, we will create sequence diagrams for the following two interactions:
Book a room: The guest books a hotel room online.
Sequence challenge: The guest checks out of their room at the reception.
Book a room
The sequence diagram for the room booking should have the following actors and objects that will interact with each other:
Actor:
Guest
Objects:
Catalog
,Booking
,Room
, andPayment
System
Here’re the steps in the book room interaction:
The guest searches for a room based on some price and style.
The catalog returns a list of rooms.
The guest selects a room they wish to book.
If the room is available:
The guest creates a booking for the room.
The booking fetches the booking price for the room.
The guest is informed that the booking is ready for payment.
The guest initiates a payment against the booking price.
The payment is processed, and the guest is informed of the status.
If the payment is successful:
The guest is informed that the payment has succeeded.
The system is informed that payment is complete.
The system updates the room status to reserved.
Else if the payment is unsuccessful:
The guest is informed that the payment has failed.
Else if the room is unavailable:
The system informs the guest that the room is unavailable.
Based on the order above, the sequence diagram of booking a room in a hotel management system is given below:
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.