
- UML - Home
- UML - Overview
- UML - Challenges & Real-world Applications
- UML - Building Blocks
- UML - Architecture
- UML - Modeling Types
- UML - Basic Notations
- UML - Standard Diagrams
- UML - Class Diagram
- UML - Object Diagram
- UML - Component Diagram
- UML - Deployment Diagram
- UML - Use Case Diagram
- UML - Interaction Diagram
- UML - Statechart Diagram
- UML - Activity Diagram
- UML - Communication Diagram
- UML - Timing Diagram
- UML - Sequence Diagram
- UML - Collaboration Diagrams
- UML - Profile Diagram
- UML - Sequence Vs. Collaboration Diagrams
- UML - Sequence Vs. Collaboration Vs. Communication Diagrams
- UML - Association Vs. Aggregation Vs. Composition
- UML - Interaction Overview Diagram
- UML - Composite Structure Diagram
- UML - Object Constraint Language
- UML - Managing Models
- UML - Summary
- UML Useful Resources
- UML - UML Interview Questions & Answers
- UML - Useful Resources
- UML - Knowledge Test
UML - Communication Diagram
UML communication diagrams, similar to sequence diagrams-a type of interaction diagram-show how objects interact. A communication diagram extends the object diagram by depicting the objects and the messages that flow between them. While a sequence diagram focuses on the time and order of events, a communication diagram emphasizes the messages exchanged between objects.
In addition to the associations among objects, a communication diagram provides a broader view by displaying the messages sent between objects. Sequence diagrams may fall short of offering the "big picture," and this is where communication diagrams offer a wider perspective of a process.
Key Components of Communication Diagrams
The following are the important components of communication diagrams −
- The symbols and notations in communication diagrams are the same as those used in sequence diagrams.
- Rectangles represent the objects that make up the application.
- Lines between class instances represent the relationships between different parts of the application.
- Arrows represent the messages that are sent between objects.
- Numbering indicates the order in which the messages are sent and the total number of messages required to complete a process.
Purpose of Communication Diagrams
The following are the key functions of communication diagrams −
- Communication diagrams illustrate message passing between objects or roles that carry out the functionalities of use cases and operations.
- They represent mechanisms within the system's architectural design.
- They capture interactions that show the flow of messages between objects and roles within a collaboration scenario.
- They help in modeling different scenarios in use cases or operations, demonstrating how various objects collaborate through interactions.
- Communication diagrams assist in identifying objects (and their classes), their attributes (such as message parameters), and operations (messages) that are involved in use cases.
Communication Diagram Elements
In a communication diagram, the objects involved in a collaboration are of two types: supplier and client.
Supplier Objects
Supplier objects are the ones that provide the method being called, meaning they receive the message.
Client Objects
Client objects call methods on supplier objects and thus send messages.
Links
The lines connecting objects in a communication diagram are known as links. These links distinguish communication diagrams from sequence diagrams, as they allow the relationships between objects to be seen.
- Each link represents a relationship between objects and indicates their ability to exchange messages with each other.
- If an object sends messages to itself, the link is represented with a loop icon.
- This loop is visible on both the UI object and the Transaction object.
Messages in Communication Diagrams
Messages in communication diagrams are depicted as arrows pointing from the client object to the supplier object. Typically, these messages represent a client invoking an operation on a supplier object. They are shown alongside the objects in the following manner −
- Message icons are associated with one or more messages.
- Messages include text that is prefixed by a sequence number.
- The sequence number signifies the order in which the message is sent.
Example of Communication Diagram
The following is an example of a communication diagram that illustrates the process of adding an event to a calendar. Even in this simple case, the specific commands and requests exchanged between different steps in the process are visible. The numbers on each line indicate the sequence and the order in which they are triggered. The use of letters shows that some actions occur concurrently.
