# UML Behavioral Diagram

**In short:** UML behavior diagrams show how a system works while it runs: how users interact with it, which steps happen, which messages flow, and how states change. Structure diagrams show only the static parts.

## Explanation

UML splits its diagrams into two groups. Structure diagrams document the static structure of a system and how its parts relate to each other (see UML Structure Diagram). Behavior diagrams show how control or information passes between those parts as the system runs.

The behavior diagram types answer different questions:

- **Use case diagram:** the ways an end user can interact with the system (see Use Case Diagram).
- **Activity diagram:** the sequence of activities, with the flow of control or the flow of objects through the system.
- **State machine diagram:** the states of a system and the transitions that trigger a move to another state (see State Machine Diagram).
- **Sequence diagram:** the order of messages that elements pass to each other to complete a task or use case (see UML Sequence Diagram).
- **Timing diagram:** how long an action needs to change the state of an element.
- **Interaction overview diagram:** the interactions in a system and how control flows between them.

The arc42 runtime view (see Runtime View) uses these diagrams to describe scenarios. It lists activity diagrams, sequence diagrams and state machines as notations. arc42 advises activity diagrams with swimlanes for runtime scenarios. It also recommends sequence diagrams, because they show the responsibility of each building block.

The arc42 TPU example draws one scenario in four ways: as a sequence diagram, a communication diagram, an activity diagram and a swimlane activity diagram. In the swimlane version, the lanes are the level-1 building blocks.

## Example

A team documents an online order. A use case diagram shows that a customer can place an order. A sequence diagram shows the messages between the shop, the payment service and the warehouse. A state machine diagram shows the order moving between states, each move triggered by a transition.

## Trade-offs

Sequence diagrams make the responsibility of each building block clear. arc42 notes they can be costly to maintain in graphical tools. Because one scenario can be drawn in several notations, pick the diagram that best fits the question you want to answer.

Behavior diagram types in UML, grouped as in the text above.

```mermaid
mindmap
  root((Behavior diagrams))
    Use case
    Activity
    State machine
    Interaction
      Sequence
      Communication
      Timing
      Interaction overview
```

## Checks

- Runtime scenarios are described with a behavior notation such as an activity diagram, sequence diagram or state machine.
- Where a sequence diagram is used, it shows the responsibility of each participating building block.
- Swimlanes in an activity diagram of a runtime scenario correspond to building blocks.

## Related

- [UML 2.5 Diagram Taxonomy](https://arc.fuet.ch/concepts/modeling-uml/uml-diagram-taxonomy.md)
- [UML Structure Diagram](https://arc.fuet.ch/concepts/modeling-uml/structure-diagram.md)
- [UML Sequence Diagram](https://arc.fuet.ch/concepts/modeling-uml/sequence-diagram.md)
- [State Machine Diagram](https://arc.fuet.ch/concepts/modeling-uml/state-machine-diagram.md)
- [Use Case Diagram](https://arc.fuet.ch/concepts/modeling-uml/use-case-diagram.md)
- [Runtime View](https://arc.fuet.ch/concepts/documentation/runtime-view.md)
- [Matching Diagram Type to System Aspect](https://arc.fuet.ch/concepts/modeling-uml/matching-diagram-type-to-system-aspect.md)
- [Unified Modeling Language (UML)](https://arc.fuet.ch/concepts/modeling-uml/uml-unified-modeling-language.md)

## Sources

- [An introduction to UML diagrams | draw.io](https://www.drawio.com/docs/diagram-types/uml/) — drawio.com, accessed 2026-11-09
- [6 - Runtime view | arc42 Documentation](https://docs.arc42.org/section-6/) — docs.arc42.org, accessed 2026-11-09
- [Tip 6-11: Use sequence diagrams to describe or specify runtime scenarios! | arc42 Documentation](https://docs.arc42.org/tips/6-11/) — docs.arc42.org, accessed 2026-11-09
- [Example Runtime View: TrafficPursuitUnit | arc42 Documentation](https://docs.arc42.org/examples/runtime-tpu-1/) — docs.arc42.org, accessed 2026-11-09
