Communication diagrams

In UML, a communication diagram shows the interactions between the objects or roles associated with lifelines and the messages that pass between lifelines. In earlier versions of UML, this diagram was called a collaboration diagram and had a different notation.

Communication diagrams are a type of interaction diagram that you can use to explore the dynamic behavior of a system or software application. They provide an alternate view of the same information as sequence diagrams. In sequence diagrams, the focus is the ordering of the messages over time; in communication diagrams the focus is the structure of the messages that pass between the objects in the interaction. These diagrams illustrate the flow of messages between objects and the implied relationships between classes.

You can use communication diagrams to explore how objects in a system or application work together. Communication diagrams can identify the following aspects of an interaction or task:
  • Objects that participate in the interaction
  • Interfaces that the participating classes require
  • Structural changes that an interaction requires
  • Data that is passed between the objects in an interaction

Communication diagrams look similar to object diagrams, in which a lifeline represent the objects in the interaction and arrows represent the messages that are passed between the lifelines. Arrowheads indicate the direction of the messages, forward or reverse, and sequence numbers indicate the order in which the messages are passed.

The following topics describe the elements in communication diagrams: