Sequence diagram

A sequence diagram is a type of UML behavioral diagram that shows how the elements of a system interact, over time, to carry out a particular scenario. It depicts the sequence, or flow, of messages exchanged between elements. Each participating object or component is drawn as a vertical lifeline showing its lifespan, and each message between two elements is drawn as a horizontal line connecting their lifelines at the point in time it occurs.

Because a sequence diagram documents one concrete scenario rather than a system’s full behavior, it is the natural notation for expressing a runtime view. Each significant scenario gets its own diagram, showing the specific building blocks involved and the order in which they exchange messages to fulfil it.

Where a class diagram or a building block view answers what a system is made of, a sequence diagram answers how those parts collaborate to do one particular thing.

Simple sequence diagrams need nothing more sophisticated than nested boxes of plain text. The added value of a formal notation, produced using a proper diagramming tool, shows up once a scenario has branching or concurrent behavior to represent.