Using Lifelines
Product Overview
Using Lifelines
When a classifier role or object appears in a sequence diagram, it will automatically
have a lifeline. Lifelines indicate the following:
·
Creation If an instance is created during the interaction, its lifeline starts at the
level of the message or stimulus that creates it; otherwise, its lifeline starts at the
top of the diagram to indicate that it existed prior to the interaction.
·
Communication Messages or stimuli between instances are illustrated with
arrows. A message or stimulus is drawn with its end on the lifeline of the
instance that sends it and its arrowhead on the lifeline of the instance that
receives it.
·
Activity The time during which an instance is active (either executing an
operation directly or through a subordinate operation) can be shown with
activations.
·
Destruction If an instance is destroyed during the interaction, its lifeline ends
at the level of the message or stimulus that destroys it, and a destruction marker
appears; otherwise, its lifeline extends beyond the final message or stimulus to
indicate that it exists during the entire interaction.
Naming Conventions
A lifeline has the name of an object or classifier role. For details, see Objects or
Classifier Roles.
Messages
A message is a model element that specifies a communication between classifier roles
and usually indicates that an activity will follow. The types of communications that
messages model include calls to operations, signals to classifier roles, the creation of
classifier roles, and the destruction of classifier roles. The receipt of a message is an
instance of an event.
For example, in the observer pattern, the instance that is the subject sends an
"Update" message to instances that are observing it. You can illustrate this behavior
13