Sequence Diagram

From Open Risk Manual

Definition

A Sequence Diagram is a type of Interaction Diagram that focuses on Message interchanges between entities. In the UML modelling context it is a type of behavior diagram that enables defining Behavior in some detail.

A sequence diagram interactions by depicting sequences of Message exchanges. In OOP design a sequence diagram describes the interactions between objects to fulfill a specific task. The focus is on the chronological order of the messages exchanged between the interactiong objects.

A sequence diagram typically shows, as parallel vertical or horizontal lines (also called lifelines), different processes or objects that "live" simultaneously, and, as horizontal or vertical arrows, the messages exchanged between them. The spatial arrangement indicates the temporal order in which messages happen.

A sequence diagram shows, as parallel vertical lines (lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. This allows the specification of simple runtime scenarios in a graphical manner.

A sequence diagram is related to but distinct from collaboration and communication diagrams that place less emphasis on the depiction of the temporal dimension.

PlantUML Elements

A PlantUML sequence diagram specifies and shows the following:

  • Actors
  • Messages (methods) invoked by these actors
  • Return values (if any) associated with previous messages
  • Indication of any loops or iteration area

Example

@startuml
'https://plantuml.com/sequence-diagram

autonumber

Payer -> Payee: Payment 
Payee --> Payer: Payment Confirmation

Payer -> Payee: Another Payment
Payee --> Payer: Another Payment Confirmation
@enduml

Sequence Diagram

References