CloudSketch AI Logo
FeaturesTemplatesPricingEnterpriseAboutContactLog in
πŸŒ™β˜€οΈ
Log inStart free
Home/Templates/Student Projects (College Reports)

πŸŽ“ Student Projects (College Reports) Β· Class UML

Online Shopping System Class Diagram

Classes for an online shop: customer, cart, order, payment strategies and order states.

More Student Projects (College Reports) templates

Drawing diagram…

What this diagram shows

  • Payment methods through an interface
  • Order composes order items with the price at purchase time
  • Order status as an enumeration

Prompt used

Class diagram for an online shopping system: User base class with Customer and Seller; Product in a Category; Customer has a ShoppingCart with CartItems; placing an order creates an Order with OrderItems and an OrderStatus enumeration; PaymentMethod is an interface implemented by CardPayment, UpiPayment and CashOnDelivery.

Mermaid code
classDiagram
  class User {
    <<abstract>>
    +int id
    +String name
    +String email
  }
  class Customer {
    +placeOrder(ShoppingCart) Order
  }
  class Seller {
    +listProduct(Product) void
  }
  class Category {
    +String name
  }
  class Product {
    +String name
    +decimal price
    +int stock
  }
  class ShoppingCart {
    +addItem(Product, int qty) void
    +total() decimal
  }
  class CartItem {
    +int quantity
  }
  class Order {
    +Date orderedOn
    +OrderStatus status
    +total() decimal
    +cancel() void
  }
  class OrderItem {
    +int quantity
    +decimal unitPrice
  }
  class OrderStatus {
    <<enumeration>>
    PLACED
    PAID
    SHIPPED
    DELIVERED
    CANCELLED
  }
  class PaymentMethod {
    <<interface>>
    +pay(decimal amount) bool
  }
  class CardPayment {
    +pay(decimal amount) bool
  }
  class UpiPayment {
    +pay(decimal amount) bool
  }
  class CashOnDelivery {
    +pay(decimal amount) bool
  }
  User <|-- Customer
  User <|-- Seller
  Category "1" o-- "many" Product
  Customer "1" *-- "1" ShoppingCart
  ShoppingCart "1" *-- "many" CartItem
  CartItem --> Product
  Customer "1" --> "many" Order
  Order "1" *-- "many" OrderItem
  OrderItem --> Product
  Order --> OrderStatus
  Order --> PaymentMethod
  PaymentMethod <|.. CardPayment
  PaymentMethod <|.. UpiPayment
  PaymentMethod <|.. CashOnDelivery

Related templates

Use CaseStudent Projects (College Reports)

Library Management System Use Case Diagram

Who uses a college library system and what each of them can do: members, the librarian and the system administrator.

Database ERDStudent Projects (College Reports)

Library Management System ER Diagram

The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.

Data FlowStudent Projects (College Reports)

Library Management System Data Flow Diagram (Level 1)

How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.

Class UMLStudent Projects (College Reports)

Library Management System Class Diagram

The main classes of a library system with attributes, methods and UML relationships.

SequenceStudent Projects (College Reports)

Library Management System Sequence Diagram (Issue a Book)

The steps when a member borrows a book: checks, loan record and the copy status update.

Use CaseStudent Projects (College Reports)

Online Examination System Use Case Diagram

What students, examiners and the administrator do in an online examination system.