Would you like to make this site your homepage? It's fast and easy...
Yes, Please make this my home page!
9.
Step 7: Interaction diagrams
While
use case diagrams present an outside
view of the system, interaction
diagrams describe how use cases are realized
as interactions among societies
of objects. There are two types of interaction
diagrams: sequence and
collaboration diagrams.
9.1.
Sequence diagrams
A sequence diagram is a graphical view of
a scenario that depicts object interactions
arranged in a time sequence. It shows the
functionality of the use cases.
Typically, an interaction diagram captures
the behaviour of one use case. It
shows a number of objects and the messages
communicated between them within the
use case.
In a sequence diagram:
- objects are represented by boxes at the top of a dashed vertical line;
- dashed vertical lines are called lifelines and represent the object's life during the interaction;
-
events (or messages or object interactions) are indicated by horizontal arrows which are directed from the lifeline representing the client object to the lifeline representing the supplier object. A self-call is a message that an objects sends to itself.
- Horizontal arrows are labelled with the event name (the message name and its argument values)
- Time ordering of events is indicated by vertical position, with the earliest event appearing on top.
-
A return message indicates a return from a message (they are represented by dashed arrows); return messages are usually drawn from right to left.
- An asynchronous message is indicated by half-arrowheads. A caller is not blocked by an asynchronous message, hence the caller can carry on with its own processing. An asynchronous message can: create a new thread, create a new object, or communicate with an already running thread.
- An activation box (focus of control) shows the period of time during which an object is performing an action either directly or through a subordinate procedure. An activation is shown as a tall thin rectangle whose top is aligned with its start time and whose bottom is aligned with its termination time.
- Object deletion is represented with a large X (objects can self-destructed or be destroyed by another message)
Two
kinds of control information worth mentioning
[Fowler, 2000a]:
- A condition, which indicates when a message is sent, i.e. the message will be sent only if the condition holds true (example of a condition is: [usersList not empty])
- An iteration marker shows that a message is sent many times to multiple receiver objects (example: *[for all users in UsersList])
An example sequence diagram is shown in Figure
9.
Figure
9 Example
sequence diagram