Rational Software Corp.

TOC PREV NEXT INDEX



Common Collaboration and Sequence Diagram Icons

Common Collaboration and Sequence Diagram Icons

There are a number of common tools that are used on both collaboration and sequence diagrams. Although they differ slightly, they illustrate common concepts or elements. Tools unique to a specific diagram type are discussed after this section.

Object

One of the primary elements of a collaboration or sequence diagram is an object. An object has state, behavior, and identity. The structure and behavior of similar objects are defined in their common class. Each object in a diagram indicates some instance of a class. An object that is not named is referred to as a class instance.

The object icon is similar to a class icon except that the name is underlined.

If you use the same name for several object icons appearing in the same collaboration diagram, they are assumed to represent the same object; otherwise, each object icon represents a distinct object. Object icons appearing in different diagrams denote different objects, even if their names are identical. Objects can be named three different ways: object name, object name and class, or just by the class name itself.

Multiple Objects

If you have multiple objects that are instances of the same class, you can modify the object icon by selecting the Multiple Instances check box in the Object Specification. When you select this check box, the icon is changed from one object to three staggered objects.

To create an icon representing multiple objects:

1 Create an object.

2 Double-click its icon to display its specification.

3 Select the Multiple Instances check box.

4 Click OK.

    Rational Rose displays the Multiple Object icon.

Figure 73 Multiple Object Diagram

Messages

A message icon represents the communication between objects, indicating that an action will follow.

Each message icon represents a message passed between two objects, and indicates the direction a message is going. A message icon in a collaboration diagram can represent multiple messages. A message icon in a sequence diagram represents exactly one message.

A message is the communication carried between two objects that triggers an event. A message carries information from the source focus of control to the destination focus of control.

A message is represented on collaboration diagrams and sequence diagrams by a message icon which visually indicates its synchronization. The synchronization of a message can be modified through the message specification.

If all messages represented by a message icon do not have the same synchronization, the simple message icon is displayed. You can change the synchronization of the message by editing the message specification.

The sequence diagram toolbox contains two message tools. The message icon tool appears as a horizontal arrow. The message to self icon appears as a message that returns to itself.

The collaboration diagram toolbox contains two message tools. The forward message tool, bearing an arrow pointing up and to the right, places a message icon from client to supplier. The reverse message tool, bearing an arrow pointing down and to the left, places a message icon from supplier to client. The default synchronization for a message is simple.

Scripts may be attached to messages to enhance the messages.

If a message is deleted, the link on the collaboration diagram remains intact.

To create a client-to-supplier message and assign it to a link between two objects (collaboration diagram only):

1 Click the Message icon.

2 Click an icon representing the link.

Rational Rose creates an unnamed, empty message assigned to the designated link. The source of this message is the client object, and the destination of this message is the supplier object.

To create a supplier-to-client message, use the Reverse Message Creation tool in the above procedure. The source of the resulting message is the supplier-object, and the destination of this message is the client-object.

To name an unnamed message:

1 Click the icon representing the message.

2 Type the name.

3 Click outside the named icon.

Rational Rose will name the message as specified and assign it a sequence number based on creation order, starting with 1.

To change message names in interaction diagrams:

1 Click the name to display a flashing vertical bar that designates the insertion point.

2 Enter additional text.

3 Click outside the named icon.

Alternatively, you can double-click an icon representing the message to display the message specification. Then, modify the Name field and click OK.

Message Numbering

To enable or disable the display of message numbers click Tools > Options. Click the Diagram tab and click Collaboration Numbering (for collaboration diagrams) or Sequence Numbering (for sequence diagrams).

To change messages numbering in interaction diagrams:

1 Create or display the interaction's sequence diagram, click Browse > Create Sequence Diagram or Browse > Go to Sequence Diagram.

2 Reorder the messages by dragging the message icons into the preferred order.

3 Redisplay the interaction diagram by clicking Browse > Go to Collaboration Diagram or Browse > Go to Sequence Diagram.

Assigning an Operation to a Message

Rational Rose allows you to assign an operation to a message by presenting a list of all operations accepted by the destination object. The list of valid operations is defined by the specification of the object's parent class and the specifications of the parent class' superclasses, as specified by its inheritance hierarchy. The Class field of the destination object's specification must be set to identify the destination object's parent class before operations can be assigned to a message to that destination object.

Assigning an operation to a message changes the name of the message to the name of the operation.

To assign an operation to a message:

1 Right-click the message icon.

2 Click an operation from the pop-up list, or click <new operation> to add and specify a new operation to the destination object's Class Specification.

If you click <new operation>, you must repeat this procedure after specifying the new operation to assign the newly-created operation to the message.

You can associate multiple messages with a message icon. Each new message is represented by an independent name and sequence number. If a message icon represents multiple messages, you must select a specific message by clicking its name.

You can also create multiple messages associated with the same message icon using the Link Specification. This method is described in Link Specification on page 154.

To change a message's assigned operation, display its specification by double-clicking its message icon. If the message icon represents multiple messages, double-click the name of the message whose operation you select to change. Select the desired operation from the specification's Referenced Operation field, or directly enter an operation name in the Name field.


Rational Software Corporation  http://www.rational.com
support@rational.com
docs@us.ibm.com
Copyright © 1993-2000, Rational Software Corporation. All rights reserved.
TOC PREV NEXT INDEX