Class Diagram for the Amazon Locker Service

Learn to create a class diagram for the Amazon Locker system problem using the bottom-up approach.

We’ll create the class diagram for the Amazon Locker service. In the class diagram, we will first design the classes for the system, and then we will identify the relationship between classes according to the requirements gathered for the Amazon Locker service problem.

Components of an Amazon Locker service

In this section, we’ll define the classes for an Amazon Locker service. As mentioned earlier, we are following the bottom-up approach to design a class diagram for the Amazon Locker service.

Item

The Item class represents each item of the order. Every item contains an Id and the order’s quantity. The class representation is shown below:

Press + to interact
The class diagram of the Item class
The class diagram of the Item class

Order

The order placed by a customer is represented by the Order class. Every order has a unique Id, contains a list of items, and the delivery location of the order. The UML representation of a class is shown below:


Press + to interact
The class diagram of the Order class
The class diagram of the Order class

Notification

The notification is sent to the customer when an order is shipped. A Notification class has a customerId, orderId, and lockerId that specify the customer to whom the notification has to be sent, against the order the notification has to be sent, and the locker where the order has arrived, respectively. Moreover, this class contains a 6-digit code to open the locker. The class definition is given below: ...

Level up your interview prep. Join Educative to access 70+ hands-on prep courses.