Roadmap › Low-Level Design (LLD) — Object Design, UML and Classic Problems in C# › Module: Foundations of Object Design
Lessons in this course (8)
2. UML class diagrams and sequence diagrams
Basic★ Must knowLesson 2 of 8
Class diagram notation:
| Symbol | Meaning | Example |
|---|---|---|
+ / - / # | public / private / protected | +Park(vehicle): Ticket |
| Solid line + hollow triangle | Inheritance (is-a) | Car ──▷ Vehicle |
| Dashed line + hollow triangle | Implements interface | UpiPayment ┈┈▷ IPayment |
| Filled diamond | Composition — part can't exist without the whole | Floor ◆── Spot |
| Hollow diamond | Aggregation — part can exist independently | Team ◇── Player |
| Plain arrow | Association / dependency | Ticket ──> Spot |
1, 0..1, *, 1..* | Multiplicity | ParkingLot 1 ── * Floor |
mermaid
classDiagram
class ParkingLot { +Park(Vehicle) Ticket +Unpark(Ticket) Receipt }
class Floor { +FindSpot(VehicleType) Spot }
class Spot { +SpotType Type +bool IsFree +Occupy(Vehicle) +Release() }
class Vehicle { <<abstract>> +string Number +VehicleType Type }
ParkingLot "1" *-- "*" Floor
Floor "1" *-- "*" Spot
Vehicle <|-- Car
Vehicle <|-- BikeSequence diagram — the order of calls between objects for one use case:
mermaid
sequenceDiagram
participant G as EntryGate
participant L as ParkingLot
participant F as Floor
participant T as TicketService
G->>L: Park(car)
L->>F: FindSpot(Car)
F-->>L: spot A-12
L->>T: Issue(car, spot)
T-->>G: Ticket #881