SEQUENCE DIAGRAMS

advertisement
Ana M. Fernández
fernande@liacs.nl

A UML diagram that depicts:
◦ interactions between objects.
◦ how the business currently works by showing how
various business objects interact.

Purpose:
1. Model flow of control
2. Identify synchronization
3. Illustrate typical scenarios


The focus is less on messages themselves and
more on the order in which messages occur.
The diagram conveys this information along 2
dimensions:
◦ the vertical dimension shows, top down, the time
sequence of messages/calls as they occur,
◦ the horizontal dimension shows, left to right, the object
instances that the messages are sent to.

Instance Name : Class Name
◦ Underlined  specific instance (Bill, Fred)
◦ Not underlined  kind of instance or role (buyer,
seller)

Message =a line to the receiving object with:
◦ a solid arrowhead (if a synchronous call operation)
◦ a stick arrowhead (if an asynchronous signal)


The message/method name is placed above the
arrowed line.
Return message = dotted line with an open arrowhead
back to the originating lifeline (above the return value
from the operation).



To model mutually exclusive choice between two
or more message sequences (if then else)
The word "alt" is placed inside the frame's
namebox.
Operands are separated by a dashed line.


To model a
sequence that,
given a certain
condition, will
occur; otherwise,
the sequence does
not occur (If then).
The word “opt" is
placed inside the
frame's namebox.


To model a repetitive sequence.
The word “loop" is placed inside the frame's
namebox (add the minimum and maximum of
iterations)



To model parallel
processing
activities.
The word “par" is
placed inside the
frame's namebox.
Break up the
frame horizontal
operands
separated by a
dashed line.

Messages:
◦ Synchronous
◦ Asynchronous
◦ Return

Alternative

Option

Loop

Pararell
Download