Collaborations
Because you do not show the specific classes or identities of the participating instances, but only the roles and connectors, you can reuse a collaboration to diagram architectural patterns of collaborating objects and to model their common behavior, similar to a template. When you want to show a specific occurrence of a pattern, you use a collaboration use.
A collaboration can include classifiers from different parts of the system being modeled, and a single classifier can play different roles and participate in multiple collaborations. This means that a role in a collaboration references or types a classifier, but the collaboration does not physically own or contain the referenced classifier.
As the following figure illustrates, a collaboration is displayed as a dashed ellipse with two compartments.
The top compartment specifies the unique name of the collaboration. Typically,
the name identifies the pattern or mechanism that the collaboration provides.
In the above example, the collaboration defines the components of a car. The
name of the collaboration is Car. The structure compartment shows the internal
structure of the collaboration by using a set of roles. In this example, the
Door and the Frame roles collaborate to define the collaboration Car. The
roles are depicted as rectangles that contain the name of the role, a colon,
and, if specified, the name of the referenced classifier. A solid line connects
the Door and the Frame roles in the collaboration.