What is a Communication Diagram?
A Communication Diagram (formerly called a Collaboration Diagram) shows the same information as a sequence diagram β object interactions β but organized around the objects and their links rather than along a time axis. It emphasizes the structural relationships between objects that participate in an interaction.
If a sequence diagram is a "movie script" (ordered by time), a communication diagram is a "network diagram" (organized by relationships). Both show the same messages, just arranged differently.
Communication Diagram Notation
Objects are shown as named instances:
ββββββββββββββββ
β :ClassName β β object name (or :ClassName for unnamed)
ββββββββββββββββ
Links connect objects (solid lines):
ββββββββββ ββββββββββ
β :A ββββββββββββ :B β
ββββββββββ ββββββββββ
Messages are numbered to show sequence:
ββββββββββ ββββββββββ
β :A βββ1.0βββββΆβ :B β
ββββββββββ ββββββββββ
β β
β 1.1 β 1.2
βΌ βΌ
ββββββββββ ββββββββββ
β :C ββββββββββββ :D β
ββββββββββ ββββββββββ
Numbering scheme:
1.0 β first message
1.1 β first sub-message of 1.0
1.2 β second sub-message of 1.0
2.0 β second top-level message
Example: Login Interaction
Let's compare the same login scenario in both diagram types:
Communication Diagram:
ββββββββββ 1: enterCredentials() ββββββββββββ
β :User ββββββββββββββββββββββββββββββββββΆβ :LoginFormβ
ββββββββββ βββββββ¬βββββ
β
2: validate() β
ββββββββββββββββββββββββββββ
βΌ
ββββββββββββ 3: findUser() ββββββββββ
β :Auth ββββββββββββββββββββββΆβ :DB β
βββββββ¬βββββ ββββββ¬ββββ
β β
β 4: userData β
βββββββββββββββββββββββββββββββββ
β
β 5: result
βββββββΌβββββ
β :LoginFormβ
βββββββ¬βββββ
β
β 6: showResult()
βββββββΌβββββ
β :User β
ββββββββββββ
Sequence Diagram (same scenario):
ββββββββ ββββββββββββ ββββββββ ββββββ
β :Userβ β :LoginFormβ β :Authβ β :DB β
ββββ¬ββββ ββββββ¬ββββββ ββββ¬ββββ ββββ¬ββ
β β β β
β 1.enter β β β
β Credentialsβ β β
βββββββββββββΆβ β β
β β 2.validate()β β
β ββββββββββββββΆβ β
β β β3.findUserβ
β β βββββββββββΆβ
β β β β
β β β4.userDataβ
β β ββββββββββββ
β β 5.result β β
β βββββββββββββββ β
β 6.show β β β
β Result β β β
ββββββββββββββ β β
Communication vs Sequence Diagrams
ββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β Feature β Comparison β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Organization β Sequence: time-ordered (vertical) β
β β Communication: structure-based β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Emphasis β Sequence: WHEN messages are sent β
β β Communication: WHO talks to WHOM β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Message ordering β Sequence: implicit (top-to-bottom) β
β β Communication: explicit (numbered) β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Loops/Conditions β Sequence: easy (combined fragments) β
β β Communication: harder to represent β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Object links β Sequence: not shown β
β β Communication: explicitly shown β
ββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ€
β Best for β Sequence: algorithm flows, workflows β
β β Communication: structural analysis β
ββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββββββ
When to Use Communication Diagrams
Use Communication Diagrams When:
β You want to see which objects interact directly
β You need to understand the structural relationships during an interaction
β You're analyzing object responsibilities in a specific scenario
β You want a compact view of an interaction
β You're doing object-oriented analysis (discovering relationships)
Use Sequence Diagrams Instead When:
β The order of messages is critical
β You need to show loops, conditions, or timing constraints
β The scenario is long or complex
β You're communicating with non-technical stakeholders
β You're documenting detailed behavior for developers
Practical Tip:
βββββββββββββ
Use BOTH diagrams for the same scenario:
β’ Communication diagram during analysis β discover relationships
β’ Sequence diagram during design β define exact interaction order
The communication diagram helps you think about structure.
The sequence diagram helps you think about behavior.
Together, they give you a complete picture.