Refining Collaboration Diagrams

This section provides techniques for refining collaboration diagrams. For information on sequence diagrams, see Refining Sequence Diagrams.

Viewing a Collaboration Diagram as a Sequence Diagram

Together allows you to quickly convert between sequence and collaboration diagrams. However, whenever you create a new diagram, you must specify that it is either a sequence or collaboration diagram, and Together tracks it as such. The diagram displays in the UML Explorer and UML Navigator as the type of origin, and opens in that view. For example, if you create a sequence diagram, it will always display in the UML Explorer and UML Navigator and open in the Diagram view as a sequence diagram. However, you can view it as a collaboration diagram.

To convert between sequence and collaboration diagrams:

  1. Right click on the diagram background.


  2. From the context menu, select Show as Sequence.


  3. Repeat this process to toggle between the two diagrams.

NB: You may also switch between diagrams using the context menu for the diagram in the UML Explorer or UML Navigator.

Creating a Message-to-self

To create a message from an object back to itself:

  1. Click on the link button on the diagram's toolbar.


  2. Click on the object where you want the message to appear.


  3. Drag the link away from the object.


  4. Drag the link back to the object and drop when the object is highlighted.

To associate a self-message link with an operation in its super class, right click on the link and choose Select Overridden Operation.

Creating a Message Link that Calls an Operation

To create a message link that calls an operation:

  1. Create a message link between two objects. The object that receives the message must be associated with a class.


  2. Select the message link label.


  3. Right click on the link label and select Choose Operation. The operations of the recipient object's class are listed in the drop down list.


  4. Select the operation and click OK. This renames the message link to the operation's name.

Specifying Non-Atomic Delivery

By default, message links are represented on a collaboration diagram as having an atomic delivery. This indicates the duration required to send the message is atomic, which means, that nothing else can happen during the message transaction. If the message link requires some time to arrive, during which something else can occur, then designate the message link as non-atomic using the Non-atomic delivery command.

To designate a message link as non-atomic:

  1. Right click on the link.


  2. Select Non-atomic Delivery from the context menu.

Techniques Specific to Collaboration Diagrams

When you draw a message between objects, a generic link line displays between the objects, and a list of messages is created above it. The link line is present as long as there is at least one message between the objects.

As you add messages, they display in time-ordered sequence from top to bottom of the messages list. You can select messages and edit their properties in the message Properties view just as you do in a sequence diagram.

The collaboration diagram adds the capability of showing relationships between objects. In addition to the default link, you can add links to show association and aggregation relationships. These links are not available in the sequence diagram.

Reordering Message Links

Select and drag message links up and down the object lifeline to reorder them. Reordering automatically updates the message link sequence numbers.

Sometimes you may wish to reorder message links keeping their sequential order and freeing the space between for new links. To do this, select a message link line, and drag it. This shifts all succeeding links. If you select multiple message links (pressing the CTRL key), then the links selected are moved keeping their increments.

Alternatively, use the sequence number property of a link (via Properties view) to reorder message links.