Previous UML Classes Table of Contents UML Packages Next


9.3.4 CollaborationUse

Collaborations


   A collaboration use represents the application of the pattern described by a collaboration to a specific situation involving specific classes or instances playing the roles of the collaboration.

*Generalizations

   

    NamedElement (from Kernel , Dependencies ) on page 99

*Description

   A collaboration use represents one particular use of a collaboration to explain the relationships between the properties of a classifier. A collaboration use shows how the pattern described by a collaboration is applied in a given context, by binding specific entities from that context to the roles of the collaboration. Depending on the context, these entities could be structural features of a classifier, instance specifications, or even roles in some containing collaboration. There may be multiple occurrences of a given collaboration within a classifier, each involving a different set of roles and connectors. A given role or connector may be involved in multiple occurrences of the same or different collaborations.

   Associated dependencies map features of the collaboration type to features in the classifier. These dependencies indicate which role in the classifier plays which role in the collaboration.

*Attributes

   No additional attributes

*Associations

*Constraints

   [1] All the client elements of a roleBinding are in one classifier and all supplier elements of a roleBinding are in one collaboration and they are compatible.

   [2] Every role in the collaboration is bound within the collaboration use to a connectable element within the classifier or operation.

   [3] The connectors in the classifier connect according to the connectors in the collaboration.

*Semantics

   A collaboration use relates a feature in its collaboration type to a connectable element in the classifier or operation that owns the collaboration use.

   Any behavior attached to the collaboration type applies to the set of roles and connectors bound within a given collaboration use. For example, an interaction among parts of a collaboration applies to the classifier parts bound to a single collaboration use. If the same connectable element is used in both the collaboration and the represented element, no role binding is required.

*Semantic Variation Points

   It is a semantic variation when client and supplier elements in role bindings are compatible.

*Notation

   A collaboration use is shown by a dashed ellipse containing the name of the occurrence, a colon, and the name of the collaboration type. For every role binding, there is a dashed line from the ellipse to the client element; the dashed line is labeled on the client end with the name of the supplier element.

Issue 6423 - No practical applications of alternate presentation option found; deleting Presentation Options subsection.

*Examples

   This example shows the definition of two collaborations, Sale ( Figure 9.13) and BrokeredSale ( Figure 9.14). Sale is used twice as part of the definition of BrokeredSale. Sale is a collaboration among two roles, a seller and a buyer. An interaction, or other behavior specification, could be attached to Sale to specify the steps involved in making a Sale.

Figure 9.13 - The Sale collaboration

   BrokeredSale is a collaboration among three roles, a producer, a broker, and a consumer. The specification of BrokeredSale shows that it consists of two occurrences of the Sale collaboration, indicated by the dashed ellipses. The occurrence wholesale indicates a Sale in which the producer is the seller and the broker is the buyer. The occurrence retail indicates a Sale in which the broker is the seller and the consumer is the buyer. The connectors between sellers and buyers are not shown in the two occurrences; these connectors are implicit in the BrokeredSale collaboration in virtue of them being comprised of Sale. The BrokeredSale collaboration could itself be used as part of a larger collaboration.

Figure 9.14 - The BrokeredSale collaboration

   BrokeredSale

   wholesale:




   seller

   retail: Sale

   buyer

    Figure 9.15 shows part of the BrokeredSale collaboration in a presentation option.

Issue 8989 -reverse direction of arrows


   «occurrence»

   Sale

   BrokeredSale

   Figure 9.15 - A subset of the BrokeredSale collaboration

   A collaboration use is used to specify the application of a pattern specified by a collaboration to a specific situation. In that regard, it acts as the invocation of a macro with specific values used for the parameters (roles).

*Changes from previous UML

   This metaclass has been added.