6.3 Interactions and Collaborations
Formally, a collection of classes, their
messages, and their associations is
known as a collaboration. A collection of
specific objects playing the roles of the classes, their stimuli, and
their specific links playing the roles of the associations, is known
as a collaboration instance. A collection of
messages is known as an interaction and a
collection of stimuli is known as
an interaction
instance. An interaction is said to occur within the
context of a collaboration because an interaction is a subset of the
contents of a collaboration; and an interaction instance is said to
occur within the context of a collaboration instance because an
interaction instance is a subset of the contents of a collaboration
instance.
You may show an interaction using one of two forms:
- Generic-form interaction
-
Shows
two or more possible sequences of
message or stimuli exchanges using repetition and conditionality.
- Repetition
-
Involves repeating
a set of messages or stimuli
— for example, repeating the set of messages or stimuli in
steps 6a and 6b of the interaction and collaboration description to
generate the project-status report.
- Conditionality
-
Involves
communicating one set of messages
or stimuli rather than another set of messages or stimuli — for
example, conditionally performing step 5 or 6 of the interaction and
collaboration description to generate the project-status report.
- Instance-form interaction
-
Shows
one actual sequence of message or
stimuli exchanges without any repetition or conditionality. For
example, generating a specific project-status report that contains
exactly three workers, each with two units of work and one work
product. Rather than showing repetition and conditionality as in a
generic-form interaction, instance-form interactions show the actual
set of messages or stimuli that are repeated and the set of messages
or stimuli that are communicated for specific conditions.
You may show a collaboration using one of two levels:
- Specification-level collaboration
-
Shows class roles, association
roles, and their messages. For example, you might use class roles,
association roles, and their messages to communicate a generic-form
or instance-form interaction.
- Instance-level Collaboration
-
Shows
specific objects, links, and their
stimuli. For example, you might use objects, links, and their stimuli
to communicate a generic-form or instance-form interaction.
In the UML, sequence and collaboration diagrams, rather than textual
descriptions, are used to capture the details of interactions,
collaborations, interaction instances, and collaboration instances.
The interaction forms and collaboration levels just described make
the UML very expressive.
|