Sequence diagram

Sequence diagram

the sequence diagram is the graphic representation of the interactions between the actors and the system in chronological order in the Unified Modeling Language formulation:

  • Description of the order of interactions between the objects that make up the system.
  • Representation focusing on the sequence of interactions from a temporal point of view.

Sequence diagrams are interaction diagrams like collaboration diagrams. They are suitable for modeling the dynamic aspects of real-time systems and complex scenarios involving few objects.

An interaction results in the sending of a message between objects. The sequence diagram makes it possible to show the objects involved in the interaction; description of the interaction and interactions between stakeholders.

Object lifeline

The object is made up of its role and / or the name of the instantiated class. The name is underlined to indicate that it is an instance. An object is always accompanied by its lifeline. It is represented by a vertical line below the object. It represents the period of time during which the instantiated object exists.

To represent an object creation, a message points to the object symbol. The destruction of the object is represented by the end of its lifeline.

lifeline uml sequence diagram

Messages and activities

Objects communicate by exchanging messages represented in the form of arrows. The vertical dimension represents the passage of time. A message placed below another will therefore be sent after the first. Messages are often labeled by the name of the operation or signal invoked. The message can represent an activation of the objects, a label, be a sequential sending or a parallel sending of n instances of the same message, and can have arguments.

A results return message is shown in dotted lines. the sending of recursive messages is represented by a doubling of the activation band. An object can send itself a message.

Messages are mainly sent during an activity, and trigger other activities. An activity period is the time during which an object performs a direct or indirect action. It is represented by a vertical strip along the object's lifeline.

uml sequence diagram lifeline message activity

Example

Let's take an example on a condition:

uml sequence diagram lifeline message activity

Or a loop:

uml sequence diagram lifeline message activity