Sequence Diagrams: Massimo Felici Room 1402, JCMB, KB 0131 650 5899 Mfelici@inf - Ed.ac - Uk
Sequence Diagrams: Massimo Felici Room 1402, JCMB, KB 0131 650 5899 Mfelici@inf - Ed.ac - Uk
Massimo Felici
Room 1402, JCMB, KB
0131 650 5899
[email protected]
What are Sequence Diagrams?
Sequence Diagrams are interaction diagrams that
detail how operations are carried out
• Interaction diagrams model important runtime interactions
between the parts that make up the system
Sequence Diagrams
• capture the interaction between objects in the context of a
collaboration
• show object instances that play the roles defined in a
collaboration
• don’t show the structural relationships between objects
• show the order of the interaction visually by using the
vertical axis of the diagram to represent time what
messages are sent and when
Time
Time
• The vertical axis
represents time
proceedings (or
progressing) down the
page
© 2004-2006 SEOC - Lecture Note 12 7
Events, Signals and Messages
An Event is any point in an
interaction where something
occurs
Signals and Messages are
similar concepts
• Messages on a sequence
diagram are specified using
an arrow from the
participant (message caller)
that wants to pass the
message to the participant
(message receiver) that is to
receive the message
• Messages: a message (or
stimulus) is represented as
an arrow going from the
sender to the top of the
activation bar of the
message on the receiver's
lifeline
© 2004-2006 SEOC - Lecture Note 12 8
Types of Messages
Reflexive Communications: similar to a reflexive association or link,
an element may communicate with itself where communication is
sent from the element to itself. Sending messages to itself means
an object has two activations simultaneously.
Repetitions: involve repeating a set of messages or stimuli within a
generic-form interaction. Messages are grouped together in a
rectangle. The expression in square brackets, [ ], is a condition. The
asterisk “*” means iteration.
Conditionality: branching results in a choice of two different
messages (or operation calls) being sent to the same object, the
lifeline of the object splits with two activations. The separate
lifelines merge back together after the completion of different
actions in response to the different messages.
Return Values: often worthwhile to label the return value because
it may be used later in the interaction