Labs ICT
⭐ Pro Login

Communication/Collaboration Diagrams

Showing object interactions organized around objects and their links.

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.

πŸ§ͺ Quick Quiz

What is the difference between a sequence diagram and a communication diagram?