OO diagrams - the communication diagram
The communication diagram is similar to the squence diagram. They both show the objects in a system, the messages that get passed between the objects and the order that they happen. Whilst they both show the same information, the difference is very subtle.
The sequence diagram emphasises the order that messages are passed in very clearly by showing the messages cascading down the diagram in the order that they are passed. It is concerned about showing the sequence of messages passed over time.
The communications diagram on the other hand, really emphasises the objects and the links between them. To read a communications diagram, you have to start at the first message and then follow the messages in the order that they are passed between the objects in the diagram. To help you do this, the messages are clearly numbered in the order that they are passed.
To see the subtle difference between the two, we need to look at a diagram of each for the same system description.
Here is the sequence diagram for a standard non-specified system:
And here is the same system represented as a communications diagram:
As you can see, the first diagram, which we met in the section to do with sequence diagrams, shows the order in which messages are passed very clearly over time, as we start at the top of the diagram and follow the messages down in the order that they happen. The second diagram shows this as well, but not quite so clearly. What is slightly clearer in the communications diagram, however, are the objects involved and the messages that pass between the objects.