UML Collaboration Diagrams
2. Types of Interactive Diagrams
As explained in activity 2.2: UML diagrams, the UML define two kinds of interaction diagrams: Collaboration diagrams and sequence diagrams, either of which can be used to express similar or identical messages interactions.
Each type has strengths and weaknesses as shown as indicated in Table 4.1:
- When drawing diagrams to be published on pages of narrow width, collaboration diagrams have the advantage of allowing vertical expansion for new objects
- Additional objects in a sequence diagram must extend to the right, which is limiting.
- On the other hand, collaboration diagram examples make it harder to easily see the sequence of messages.
Table 4.1: Sequence Diagram Versus Collaboration Diagram
Type | Strengths | Weaknesses |
Sequence Diagram | Clearly shows sequence or time ordering of messages Simple notation |
Forced to extend to the right when adding new objects; consumes horizontal space |
Collaboration Diagram | Space economy – flexibility to add new objects in two dimensions
Better to illustrate complex branching, iteration, and concurrent behaviour |
Difficult to see sequence of messages
More complex notation |
We have used system sequence diagrams in object oriented analysis, but now we are referring to another name object sequence diagram. Table 4.2 describes the difference between the system sequence diagram and object sequence diagram. You can note that the object sequence diagram is being used at design phase.
Table 4.2: Difference Between System Sequence Diagram and Object Sequence Diagram
System Sequence Diagrams | Object Sequence Diagrams |
Illustrates the interaction between the whole system and external actors | Shows the interactions between objects of the system
|
Shows only system's external events and thus identifies system operations | Identifies operations of objects
|
Are created during the analysis phase | Are models created and used in the design phase |