Sequence Diagram for the Parking Lot
Create a sequence diagram for the card payment in the parking lot system and solve a challenge.
We'll cover the following
A sequence diagram is 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 parking lot system. For the sake of this lesson, we will create sequence diagrams for the following two interactions:
Card payment: This performs a payment using the card.
Sequence challenge: This is for payment verification.
Card payment
The sequence diagram for the card payment should have the following actors and objects that will interact with each other:
Actor:
Customer
Object:
CardReader
,Payment
, andExitPanel
Here are the steps in the card payment interaction:
The customer inserts the card into the card reader.
The card reader initiates a payment for the required parking fee.
The payment processes the payment and returns the payment status.
The card reader ejects the card.
If the payment is successful:
The customer requests a receipt for the transaction.
The exit panel prints a receipt for the customer.
If the payment is unsuccessful:
The customer sees an error message for an unsuccessful Payment.
Note: The
Payment
object is created when a vehicle enters the parking lot.
Based on the order above, the sequence diagram of the card payment in a parking lot system is given below.