Collaboration Diagram in UML
In the last article, we saw what Sequence diagrams are, the notations to be used in Sequence diagrams, their significance, and how to make a Sequence diagram using Poseidon. We then made a Sequence diagram for our Courseware Management System. The next in the dynamic diagrams in UML that we will cover is the Collaboration Diagram.
In the previous article, we covered the basics of a Sequence diagram. A Sequence diagram is dynamic, and, more importantly, is time ordered. A Collaboration diagram is very similar to a Sequence diagram in the purpose it achieves; in other words, it shows the dynamic interaction of the objects in a system. A distinguishing feature of a Collaboration diagram is that it shows the objects and their association with other objects in the system apart from how they interact with each other. The association between objects is not represented in a Sequence diagram.
A Collaboration diagram is easily represented by modeling objects in a system and representing the associations between the objects as links. The interaction between the objects is denoted by arrows. To identify the sequence of invocation of these objects, a number is placed next to each of these arrows.
Defining a Collaboration diagram
A sophisticated modeling tool can easily convert a collaboration diagram into a sequence diagram and the vice versa. Hence, the elements of a Collaboration diagram are essentially the same as that of a Sequence diagram.
Let us see in detail what the elements of Collaboration diagram are.
Elements of a Collaboration diagram
A Collaboration diagram consists of the following elements:
|Element and its description||Symbol|
|Object: The objects interacting with each other in the system. Depicted by a rectangle with the name of the object in it, preceded by a colon and underlined.|
|Relation/Association: A link connecting the associated objects. Qualifiers can be placed on either end of the association to depict cardinality.|
|Messages: An arrow pointing from the commencing object to the destination object shows the interaction between the objects. The number represents the order/sequence of this interaction.|
Creating a Collaboration diagram
Click here for a larger image.
Figure 9.1: Screen shot of the Poseidon tool
The screen shot of the Poseidon tool in Figure 9.1 shows the different options to model Collaboration diagrams and define associations and interactions between objects. Since a Collaboration diagram is very similar to a Sequence diagram, a few sophisticated UML tools provide automatic generation of Collaboration diagrams from Sequence diagrams.
Page 1 of 2