Previous UML Classes Table of Contents UML Packages Next


14.3.18 InteractionUse

Fragments


*Generalizations

   

    InteractionFragment (from BasicInteractions , Fragments ) on page 505

*Description

   An InteractionUse refers to an Interaction. The InteractionUse is a shorthand for copying the contents of the referred Interaction where the InteractionUse is. To be accurate the copying must take into account substituting parameters with arguments and connect the formal gates with the actual ones.

   It is common to want to share portions of an interaction between several other interactions. An InteractionUse allows multiple interactions to reference an interaction that represents a common portion of their specification.

   Description

   InteractionUse is a specialization of InteractionFragment .

   An InteractionUse has a set of actual gates that must match the formal gates of the referenced Interaction.

   Associations

   Constraints

   [1] Actual Gate s of the InteractionUse must match Formal Gate s of the referred Interaction. Gate s match when their names are equal.

   [2] The InteractionUse must cover all Lifeline s of the enclosing Interaction that appear within the referred Interaction.

   [3] The arguments of the InteractionUse must correspond to parameters of the referred Interaction.

   [4] The arguments must only be constants, parameters of the enclosing Interaction or attributes of the classifier owning the enclosing Interaction.

   Semantics

   The semantics of the InteractionUse is the set of traces of the semantics of the referred Interaction where the gates have been resolved as well as all generic parts having been bound such as the arguments substituting the parameters.

   Notation

   The InteractionUse is shown as a CombinedFragment symbol where the operator is called ref. The complete syntax of the name (situated in the InteractionUse area) is:

   <name> ::=[<attribute-name> ‘=’ ] [<collaboration-use> ‘.’] <interaction-name>

   [‘(‘ <io-argument> [‘,’ <io-oargument>]* ‘)’] [‘:’ <return-value>

   <io-argument> ::= <in-argument> | ‘out’ <out-argument>]

   The <attribute-name> refers to an attribute of one of the lifelines in the Interaction.

   <collaboration-use> is an identification of a collaboration use that binds lifelines of a collaboration. The interaction name is in that case within that collaboration. See example of collaboration uses in Figure 14.25.

   The io-arguments are most often arguments of IN-parameters. If there are OUT- or INOUT-parameters and the output value is to be described, this can be done following an out keyword.

   The syntax of argument is explained in the notation section of Messages (Message (from BasicInteractions ) on page 512).

   If the InteractionUse returns a value, this may be described following a colon at the end of the clause.

   Examples

Figure 14.17 - InteractionUse

    In Figure 14.17 we show an InteractionUse referring the Interaction EstablishAccess with (input) argument Illegal PIN. Within the optional CombinedFragment there is another InteractionUse without arguments referring OpenDoor.

Figure 14.18 - InteractionUse with value return

   return parameter as Lifeline

   inout parameter as

   Lifeline

   InteractionUse with valuereturn

   argument with output

   In Figure 14.18 we have a more advanced Interaction that models a behavior returning a Verdict value. The return value from the Interaction is shown as a separate Lifeline a_op_b. Inside the Interaction there is an InteractionUse referring a_util_b with value return to the attribute xc of :xx with the value 9, and with inout parameter where the argument is w with returning out-value 12.

   Changes from previous UML

   InteractionUse was not a concept in UML 1.x.