← All concepts
TechnologyDevelopment

UML diagrams

The UML diagram families and when to use each — structure vs behaviour.

UML (Unified Modeling Language) is a standard notation for modelling software. Its diagrams split into structural (what the system *is*) and behavioural (what it *does*).

Structural diagrams

DiagramShows
ClassClasses, their attributes, methods, and relationships
ObjectSpecific instances at one moment in time
ComponentHow code is packaged into components
DeploymentHardware nodes and what runs on them

Behavioural diagrams

DiagramShows
Use caseActors and the goals they pursue
SequenceMessages exchanged between objects over time
ActivityA workflow or flowchart of steps
State machineAn object's states and the transitions between them

Reading a class box

+-------------------+
|      Account      |   <- name
+-------------------+
| - balance: int    |   <- attributes
+-------------------+
| + deposit(n)      |   <- operations
| + withdraw(n)     |
+-------------------+
Tip:Visibility markers: + public, - private, # protected.