
π Student Projects (College Reports) Β· Class UML
Classes for an online shop: customer, cart, order, payment strategies and order states.
Drawing diagramβ¦
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.
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 <|.. CashOnDeliveryWho uses a college library system and what each of them can do: members, the librarian and the system administrator.
The database of a library system: books and their copies, authors, members, loans, reservations and fines, with keys and cardinality.
How data moves through a library system: members and the librarian, the main processes, and the data stores they read and write.
The main classes of a library system with attributes, methods and UML relationships.
The steps when a member borrows a book: checks, loan record and the copy status update.
What students, examiners and the administrator do in an online examination system.