zhuang@linux:~/notes/software-design/uml-diagrams-overview/$ cat

UML Diagrams: An Overview

$ grep tags uml-diagrams-overview.md

The Unified Modeling Language (UML) provides a standard set of diagrams for describing a system from different perspectives. UML 2.5 defines 14 diagram types, classified into structure diagrams and behavior diagrams. Interaction diagrams form a subset of behavior diagrams.

Classification

text
UML diagrams
├── Structure diagrams
│   ├── Class diagram
│   ├── Object diagram
│   ├── Component diagram
│   ├── Composite structure diagram
│   ├── Package diagram
│   ├── Deployment diagram
│   └── Profile diagram
└── Behavior diagrams
    ├── Use case diagram
    ├── Activity diagram
    ├── State machine diagram
    └── Interaction diagrams
        ├── Sequence diagram
        ├── Communication diagram
        ├── Interaction overview diagram
        └── Timing diagram

The two main categories answer different kinds of questions:

  • Structure diagrams describe what the system is made of and how its elements are organized.
  • Behavior diagrams describe what the system does and how it changes over time.
  • Interaction diagrams focus specifically on communication between system elements.

Structure Diagrams

Structure diagrams present the static aspects of a system.

DiagramOverview
Class diagramShows classes, their features, and relationships.
Object diagramShows object instances and their links at a particular moment.
Component diagramShows software components and the dependencies between them.
Composite structure diagramShows the internal structure of a classifier and how its parts collaborate.
Package diagramShows how model elements are grouped into packages and how packages depend on one another.
Deployment diagramShows software artifacts deployed onto hardware or execution environments.
Profile diagramShows extensions that adapt UML to a particular domain or platform.

Behavior Diagrams

Behavior diagrams present the dynamic aspects of a system.

DiagramOverview
Use case diagramShows system goals and the external actors that interact with the system.
Activity diagramShows workflows, actions, decisions, and concurrent flows.
State machine diagramShows the states of an element and the transitions between them.

Interaction Diagrams

Interaction diagrams are behavior diagrams that describe how participants exchange messages.

DiagramOverview
Sequence diagramEmphasizes the time-ordered exchange of messages.
Communication diagramEmphasizes the links between participants that exchange messages.
Interaction overview diagramProvides a high-level flow that coordinates other interactions.
Timing diagramEmphasizes state or value changes along a time axis.

Choosing a Category

Start with the question the model should answer:

  • Use a structure diagram to describe organization, composition, or deployment.
  • Use a behavior diagram to describe goals, workflows, or lifecycle changes.
  • Use an interaction diagram to describe communication and message flow.

A system rarely needs every UML diagram. Choose only the diagrams that clarify the design for their intended audience.

References

  1. Object Management Group. OMG Unified Modeling Language (OMG UML), Version 2.5.1. 2017.
  2. Martin Fowler. UML Distilled: A Brief Guide to the Standard Object Modeling Language. 3rd ed., Addison-Wesley, 2003.

zhuang@linux:~/notes/software-design/uml-diagrams-overview/$ comments