Classes in this class diagram
- Subject — 4 members
- Observer — 2 members
- PriceTicker — 3 members
- ChartView — 1 member
- AlertService — 2 members
- PricingStrategy — 2 members
- DiscountStrategy — 2 members
- SurgeStrategy — 2 members
How to use this class diagram template
- Click Open in the editor. The class diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the Mermaid source below and paste it in through ☰ → Import diagram (see the Mermaid editor); it imports as an editable diagram.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
Mermaid source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
classDiagram
class Subject {
<<interface>>
+attach(Observer o) void
+detach(Observer o) void
+notify() void
}
class Observer {
<<interface>>
+update(Subject s) void
}
class PriceTicker {
-float price
+setPrice(float p) void
+notify() void
}
class ChartView {
+update(Subject s) void
}
class AlertService {
+float threshold
+update(Subject s) void
}
class PricingStrategy {
<<interface>>
+quote(float base) float
}
class DiscountStrategy {
+float percent
+quote(float base) float
}
class SurgeStrategy {
+float multiplier
+quote(float base) float
}
Subject <|.. PriceTicker
Observer <|.. ChartView
Observer <|.. AlertService
Subject o-- Observer
PricingStrategy <|.. DiscountStrategy
PricingStrategy <|.. SurgeStrategy
PriceTicker --> PricingStrategy : uses
Related: Mermaid editor · All uml: sequence, class & state templates · All 521 templates