Sequence Diagram for the Car Rental System
Create a sequence diagram for online vehicle reservation in the car rental 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 car rental system. For the sake of this lesson, we will create sequence diagrams for the following two interactions:
Vehicle reservation: The member reserves a vehicle.
Sequence challenge: The member cancels their reservation.
Vehicle reservation
The sequence diagram for vehicle reservation should have the following actors and objects that will interact with each other:
Actor:
Member
Objects:
Catalog
,Reservation
, andPayment
System
Here are the steps in the reserve vehicle interaction:
The member searches for a vehicle.
If the vehicle is available:
The catalog returns a list of available vehicles.
The member selects a vehicle to reserve.
The system creates a reservation against the vehicle.
The reservation fee is sent to the system.
The system requests payment from the member.
The member initiates payment against the reservation fee.
The payment is processed.
If the payment is successful:
The system is informed that the payment is completed.
The system updates the reservation status to “confirmed”.
The member is informed that the vehicle is reserved.
Else if the payment is unsuccessful:
The system is informed that the payment has failed.
The system deleted the reservation.
The system informs the member that the reservation is unsuccessful.
Else, if the vehicle is unavailable:
Members are notified that no vehicles are available.
Based on the order above, the sequence diagram of a vehicle reservation in a car rental system is provided below:
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.