A collaboration diagram, also known as a communication diagram, is an illustration of the relationships and interactions between software objects in the Unified Modeling Language (UML). Developers can use these diagrams to describe the dynamic behavior of specific use cases and define the role of each object.
To create a collaboration diagram, first identify the structural elements needed to perform the interaction functionality. Then build the model using the relationships between the elements. Several vendors offer software for creating and editing collaboration diagrams.
Collaboration diagram notation
Collaboration diagrams are like flowcharts that depict the roles, functionality and behavior of individual objects and the overall operation of the system in real time. The four main components of a collaboration diagram include the following:
- Objects. It displays as a rectangle with a naming label inside. The naming label follows the object name convention: class name. If an object has properties or state that specifically affect collaboration, these should also be considered.
- Actor. This is an example calling the interactions in the chart. Each actor has a name and a role, with one actor starting the entire use case.
- Link. It connects objects with actors and is depicted using a solid line between the two elements. Each link is an example where messages can be sent.
- Messages between objects. It is displayed as a labeled arrow placed near the link. These messages are communications between objects that convey information about the activity and can include sequence numbers.
- The most important object is placed in the center of the diagram, with all the other participating objects branching out. Once all objects are placed, links and messages must be added between them.
When to use collaboration charts
Developers should use collaboration diagrams when it is important to show relationships between objects. Some examples of where collaboration diagrams can help include the following:
- Modeling collaboration, mechanism or structural organization in system design.
- Provides an overview of object collaboration in object-oriented systems.
- Displays many alternative scenarios for the same use case.
- Demonstrate forward and reverse engineering.
- Capture the passage of information between objects.
- Visualize the complex logic behind operations.
However, collaboration diagrams are best suited for depicting simple interactions among a relatively small number of objects. As the number of objects and messages increases, collaboration diagrams can become difficult to read and use efficiently. In addition, collaboration charts usually exclude descriptive information, such as time.
In UML, the two types of interaction diagrams are collaboration diagrams and sequence diagrams. Although the two types use similar information, they display it in different ways. Collaboration diagrams visualize the structural organization of objects and their interactions. On the other hand, sequence diagrams focus on the sequence of messages flowing between objects. In most scenarios, one number is not sufficient to describe the behavior of the system and both numbers are required.
The above material was delivered by a presenter from Indonesia in an international visiting lecturer held by STEKOM University in collaboration with Universities from Ukraine. The title of the presentation is "Engineering in the Software Development Model". The name of the presenter is Migunani Hudayatullah, S.Kom., M.Kom. Mr. Migunanani is an active lecturer and head of the Information Systems study program at STEKOM University.
This international webinar activity is part of the implementation of STEKOM University's commitment to increase various international activities. This was done in order to realize the vision to become an international-class university. Various international activities carried out by STEKOM University continue from year to year. There are international activities that are sustainable and there are also some international activities that are not sustainable. All types of international activities are accommodated and regulated by the International department of STEKOM University.