Difference between revisions of "Sequence Diagram"

From Open Risk Manual
Line 10: Line 10:
 
A sequence diagram is related to but distinct from collaboration and communication diagrams that place less emphasis on the depiction of the temporal dimension.
 
A sequence diagram is related to but distinct from collaboration and communication diagrams that place less emphasis on the depiction of the temporal dimension.
  
== Elements ==
+
== PlantUML Elements ==
A sequence diagram specifies and shows the following:
+
A PlantUML sequence diagram specifies and shows the following:
  
 
* Actors
 
* Actors
Line 17: Line 17:
 
* Return values (if any) associated with previous messages
 
* Return values (if any) associated with previous messages
 
* Indication of any loops or iteration area
 
* 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
  
 
== References ==
 
== References ==
 
<references/>
 
<references/>
 
* [[wikipedia:Sequence diagram | Sequence Diagram @ Wikipedia]]
 
* [[wikipedia:Sequence diagram | Sequence Diagram @ Wikipedia]]
 +
* [https://plantuml.com/guide PlantUML Language Reference Guide]
  
 
[[Category:PlantUML]]
 
[[Category:PlantUML]]

Revision as of 13:43, 16 February 2022

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

References