Design Amazon
Design Amazon
Shopping System
Let's design an online retail store.
Amazon (amazon.com) is the world’s largest online retailer. The
company was originally a bookseller but has expanded to sell a
wide variety of consumer goods and digital media. For the sake of
this problem, we will focus on their online retail business where
users can sell/buy their products.
Here are the top use cases of the Online Shopping System:
Class diagram
Here are the descriptions of the different classes of our Online
Shopping System:
Guest: Guests can search for and view products, and add
them in the shopping cart. To place an order they have to
become a registered member.
Catalog: Users of our system can search for products by their
name or category. This class will keep an index of all products
for faster search.
Product: This class will encapsulate the entity that the users
of our system will be buying and selling. Each Product will
belong to a ProductCategory.
Activity Diagram
Following is the activity diagram for a user performing online
shopping:
Sequence Diagram
1. Here is the sequence diagram for searching from the catalog:
Code
Here is the high-level definition for the classes described above.