Sequence Diagram for the Amazon Online Shopping System
Create a sequence diagram for checkout and payment of an order, 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 the Amazon online shopping system. For this lesson, we’ll create sequence diagrams for the following two interactions:
Checkout and payment: The user checks out and pays for their order using a credit card.
Sequence challenge: The user searches and adds an item to the shopping cart.
Checkout and payment
The sequence diagram for order checkout and payment should have the following actors and objects that will interact with each other:
Actor:
Customer
Objects:
ShoppingCart
,Order
,Item
, andPayment
Here’re the steps in the order checkout and payment interaction:
The customer requests the shopping cart items and amount.
The customer then places the order for the requested items.
The items are verified for availability.
If the item quantity is less than the available count:
The order status is updated.
The customer is informed that the order is ready for payment.
The customer initiates a payment against the order amount using their card.
The payment is processed.
The customer is informed of the updated payment status.
Else if the item quantity is greater than the available count:
The item in the order is unavailable.
The customer receives an error for the unavailable item.
Based on the order above, the sequence diagram below represents the order checkout and payment process in an online shopping system.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.