Collaboration Diagram:
- It’s a way to show how different parts of a software system interact or communicate.
- Objects are represented as rectangles, actors (like users) initiate actions, links connect them, and messages show interactions.
Terms and Symbols:
- Objects:
- Shown as rectangles with names inside (e.g.,
:FullTimeEmployee
).
- Shown as rectangles with names inside (e.g.,

- Actors:
- Users or entities initiating actions (e.g.,
MonthlyPayPrint
).
- Users or entities initiating actions (e.g.,

- Links:
- Solid lines connecting objects and actors (e.g.,
MonthlyPayPrint -----> :FullTimeEmployee
).
- Solid lines connecting objects and actors (e.g.,

- Messages:
- Arrows with labels showing interactions (e.g.,
2a:=calculatePay()
).
- Arrows with labels showing interactions (e.g.,
Polymorphism Example:
- Imagine a system calculating pay for different employees: Full-time, Part-time, and Temporary.
- Each employee type has a different way of calculating pay.
- Polymorphism allows using the same message (
calculatePay()
) for all employee types. - The collaboration diagram () shows MonthlyPayPrint asking each employee type to calculate pay using the same message.
- MonthlyPayPrint doesn’t need to know the details of each employee type; it just knows they can all respond to
calculatePay()
.
