Collaboration Diagrams

A collaboration diagram shows elements as they interact over time and how they are related. That is, it shows a collaboration or collaboration instance. While sequence diagrams are time-oriented and emphasize the overall flow of an interaction, collaboration diagrams are time- and space-oriented and emphasize the overall interaction, the elements involved, and their relationships. Sequence diagrams are especially useful for complex interactions, because you read them from top to bottom. Collaboration diagrams are especially useful for visualizing the impact of an interaction on the various elements, because you can place an element on a diagram and immediately see all the other elements with which it interacts.

Elements

Collaboration diagrams are made up of a number of elements, including class roles, specific objects, association roles, and specific links. All of these are described in the following subsections.

Class and association roles

In a collaboration diagram, class roles and other classes are shown using the same notation as in sequence diagrams. An association role is shown using the notation for associations as defined in Chapter 3, but the association name is preceded by a forward slash followed by the name of the role followed by a colon to which links must conform to participate within the role. Other associations may also be shown as necessary using the notation for associations as defined in Chapter 3.

Class roles, association roles, other classes, ...

Get Learning UML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.