Course Content
Data Structures & Algorithms
Low Level System Design
LLD Topics
High Level Design
DSA, High & Low Level System Designs
About Lesson
Purpose of the Class Diagram

The class diagram represents the static structure of the system. It describes the classes, their attributesmethods, and the relationships (associations, dependencies, aggregations) between them.



Key Classes and Their Descriptions


1. User (Abstract Class)

Attributes:

  • userId: String
  • name: String
  • email: String
  • password: String

 

Methods:

  • login()
  • logout()
  • updateProfile()

 

This acts as the base class for Customer, Seller, and Admin.



2. Customer (extends User)

Attributes:

  • addressList: List<Address>
  • cart: Cart

 

Methods:

  • addToCart(product)
  • placeOrder()
  • viewOrderHistory()
  • writeReview(product, review)


3. Seller (extends User)

Attributes:

  • storeName: String
  • productList: List<Product>

 

Methods:

  • addProduct(product)
  • updateInventory(product)
  • viewOrders()


4. Admin (extends User)

Attributes:

  • adminLevel: int

 

Methods:

  • approveSeller(seller)
  • blockUser(userId)
  • manageCategories()


5. Product

Attributes:

  • productId: String
  • name: String
  • description: String
  • price: double
  • stockQuantity: int
  • rating: double

 

Methods:

  • updateStock()
  • calculateDiscount()


6. Cart

Attributes:

  • cartId: String
  • items: List<CartItem>

 

Methods:

  • addItem(product, quantity)
  • removeItem(productId)
  • calculateTotal()


7. CartItem

Attributes:

  • product: Product
  • quantity: int


8. Order

Attributes:

  • orderId: String
  • orderDate: Date
  • customer: Customer
  • items: List<OrderItem>
  • status: String
  • totalAmount: double

 

Methods:

  • updateStatus()
  • cancelOrder()


9. OrderItem

Attributes:

  • product: Product
  • quantity: int
  • priceAtPurchase: double


10. Payment

Attributes:

  • paymentId: String
  • amount: double
  • paymentDate: Date
  • paymentMethod: String

 

Methods:

  • processPayment()
  • refundPayment()


11. Delivery

Attributes:

  • deliveryId: String
  • orderId: String
  • deliveryStatus: String
  • estimatedDeliveryDate: Date

 

Methods:

  • updateStatus()

 

12. Review

Attributes:

  • reviewId: String
  • rating: int
  • comment: String
  • customer: Customer
  • product: Product

 

Methods:

  • editReview()
  • deleteReview()


Relationships

  • Customer uses Cart and places Order
  • Order has OrderItems and is associated with Payment and Delivery
  • Product is managed by Seller and reviewed by Customer
  • User is the base class for CustomerSeller, and Admin
  • Cart contains CartItems, each linked to a Product
0% Complete
WhatsApp Icon

Hi Instagram Fam!
Get a FREE Cheat Sheet on System Design.

Hi LinkedIn Fam!
Get a FREE Cheat Sheet on System Design

Loved Our YouTube Videos? Get a FREE Cheat Sheet on System Design.