What Is Sequence Diagram?
What Is Sequence Diagram?
At a Glance
Object Dimension
Time Dimension
Notations
UML Sequence Diagrams are interaction diagrams that detail how operations are carried out. They capture the
Message & Focus of Control
interaction between objects in the context of a collaboration. Sequence Diagrams are time focus and they
show the order of the interaction visually by using the vertical axis of the diagram to represent time what
Sequence Fragments
messages are sent and when.
Related Links
the interaction that takes place in a collaboration that either realizes a use case or an operation (instance
diagrams or generic diagrams)
high-level interactions between user of the system and the system, between the system and other systems,
or between subsystems (sometimes known as system sequence diagrams)
Free Download
Model the interaction between object instances within a collaboration that realizes a use case
Model the interaction between objects within a collaboration that realizes an operation
Either model generic interactions (showing all possible paths through the interaction) or speci!c instances
of a interaction (showing just one path through the interaction)
Object Dimension
The horizontal axis shows the elements that are involved in the interaction
Conventionally, the objects involved in the operation are listed from left to right according to when they
take part in the message sequence. However, the elements on the horizontal axis may appear in any order
Time Dimension
The vertical axis represents time proceedings (or progressing) down the page.
Note that:
Time in a sequence diagram is all a about ordering, not duration. The vertical space in an interaction diagram
is not relevant for the duration of the interaction.
Below is a sequence diagram for making a hotel reservation. The object initiating the sequence of messages is
a Reservation window.
Note That: Class and object diagrams are static model views. Interaction diagrams are dynamic. They describe
how objects collaborate.
Actor
a type of role played by an entity that interacts with the subject (e.g., by
exchanging signals and data)
Note that:
A person may play the role of several di"erent actors and, conversely, a
given actor may be played by multiple di"erent person.
Lifeline
Activations
The top and the bottom of the of the rectangle are aligned with the
initiation and the completion time respectively
Call Message
Return Message
Self Message
Recursive Message
Create Message
Destroy Message
Duration Message
Duration message shows the distance between two time instants for a
message invocation.
Note
It represents the period during which an element is performing an operation. The top and the bottom of the
rectangle are aligned with the initiation and the completion time respectively.
Sequence Fragments
UML 2.0 introduces sequence (or interaction) fragments. Sequence fragments make it easier to create and
maintain accurate sequence diagrams
A sequence fragment is represented as a box, called a combined fragment, which encloses a portion of the
interactions within a sequence diagram
The fragment operator (in the top left cornet) indicates the type of fragment
alt Alternative multiple fragments: only the one whose condition is true will execute.
Optional: the fragment executes only if the supplied condition is true. Equivalent to an alt only
opt
with one trace.
loop Loop: the fragment may execute multiple times, and the guard indicates the basis of iteration.
region Critical region: the fragment can have only one thread executing it at once.
Reference: refers to an interaction de!ned on another diagram. The frame is drawn to cover
ref
the lifelines involved in the interaction. You can de!ne parameters and a return value.
Note That:
Combined fragment keywords: alt, opt, break, par, seq, strict, neg, critical, ignore, consider, assert and loop.
Constraints are usually used to show timing constraints on messages. They can apply to the timing of one
message or intervals between messages.
"the speci!cation of a sequence of actions, including variants, that a system (or entity) can perform, interacting
with actors of the system."
A scenario is one path or #ow through a use case that describes a sequence of events that occurs during one
particular execution of a system which is often represented by a sequence diagram.
A good sequence diagram is still a bit above the level of the real code
Free Download
Related Links