Purpose Sequence diagrams are used to model the logic of usage scenarios by showing the information passed between objects in the system through the execution of the scenario.
Description
A sequence diagram shows how processes or objects interact during a scenario. The classes required to execute the scenario and the messages they pass to one another (triggered by steps in the use case) are displayed on the diagram. The sequence diagram shows how objects used in the scenario interact, but not how they are related to one another. Sequence diagrams are also often used to show how user interface components or software components interact.
The diagram represents information in a horizontal and vertical alignment. The objects that send messages to each other are represented as boxes that are aligned at the top of the page from the left to the right, with each object occupying a column of space on the page bordered by a vertical line stretching down to the bottom of the page. The messages that are sent from one object to
the next are represented as horizontal arrows. The order of the messages is represented in a top-down and left-to-right sequence beginning with the first message at the top left of the page and subsequent messages occurring to the right and below. Sequence diagrams are sometimes called event diagrams. The standard notation for sequence diagrams is defined as part of the Unified Modelling LanguageTM (UML®) specification.
Elements .1 Lifeline
A lifeline represents the lifespan of an object during the scenario being modelled in a sequence diagram. The example below shows the object order. A lifeline is drawn as a dashed line that vertically descends from each object box to the bottom of the page.
.2 Activation Box
An activation box represents the period during which an operation is executed. A call to activate is represented by an arrow with a solid arrowhead leading to the activation object. The lifeline can be terminated with an X.
.3 Message
A message is an interaction between two objects. A message is shown as an arrow coming from the activation box of the object that sends the message to the
activation box of the object that receives the message.
The name of the message is placed on top of the arrowed line. There are different types of messages: