Communication Diagrams

A communication diagram is a UML diagram that provides a graphical view of the interactions between objects for a use case scenario, the execution of an operation, or an interaction between classes, with an emphasis on the system structure.

Note: To create a communication diagram in an existing OOM, right-click the model in the Browser and select New > Communication Diagram. To create a new model, select File > New Model, choose Object Oriented Model as the model type and Communication Diagram as the first diagram, and then click OK. To create a communication diagram that reuses the objects and messages from an existing sequence diagram (and creates instance links between the objects that communicate using messages, updating any message sequence numbers based upon the relative position of messages on the timeline), right-click in the sequence diagram and select Create Default Communication Diagram, or select Tools > Create Default Communication Diagram. Note that the two diagrams do not remain synchronized – changes made in one diagram will not be reflected in the other.

You can use one or more communication diagrams to enact a use case or to identify all the possibilities of a complex behavior.

A communication diagram conveys the same kind of information as a sequence diagram, except that it concentrates on the object structure in place of the chronology of messages passing between them.

A communication diagram shows actors, objects (instances of classes) and their communication links (called instance links), as well as messages sent between them. The messages are defined on instance links that correspond to a communication link between two interacting objects. The order in which messages are exchanged is represented by sequence numbers.



Analyzing a Use Case

A communication diagram can be used to refine a use case behavior or description. This approach is useful during requirement analysis because it may help identify classes and associations that did not emerge at the beginning.

You can formalize the association between the use case and the communication diagram by adding the diagram to the Related Diagrams tab of the property sheet of the use case.

It is often necessary to create several diagrams to describe all the possible scenarios of a use case. In this situation, it can be helpful to use the communication diagrams to discover all the pertinent objects before trying to identify the classes that will instantiate them. After having identified the classes, you can then deduce the associations between them from the instance links between the objects.

The major difficulty with this approach consists in identifying the correct objects to transcribe the action steps of the use case. An extension to UML, "Robustness Analysis" can make this process easier. This method recommends separating objects into three types:
  • Boundary objects are used by actors when communicating with the system; they can be windows, screens, dialog boxes or menus

  • Entity objects represent stored data like a database, database tables, or any kind of transient object such as a search result

  • Control objects are used to control boundary and entity objects, and represent the transfer of information

PowerDesigner supports the Robustness Analysis extension through an extension file (see Customizing and Extending PowerDesigner > Extension Files > Example: Creating Robustness Diagram Extensions.

Analyzing a Class Diagram

Building a communication diagram can also be the opportunity to test a static model at the conception level; it may represent a scenario in which classes from the class diagram are instantiated to create the objects necessary to run the scenario.

It complements the class diagram that represents the static structure of the system by specifying the behavior of classes, interfaces, and the possible use of their operations.

You can create the necessary objects and instance links automatically by selecting the relevant classes and associations in a class diagram, and then pressing CTRL+SHIFT while dragging and dropping them into a an empty communication diagram. Then you have simply to add the necessary messages.