Working with a UML 1.5 Message
Go Up to Interaction Diagram Procedures
This section describes techniques for working with messages in Sequence and Collaboration diagrams. Although the two diagram types are equivalent, the techniques for dealing with messages differ.
In a Collaboration diagram, all messages between the two objects are displayed as a generic link line, 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. Messages display in time-ordered sequence from top to bottom of the messages list. In addition to the message links, you can add links that show association and aggregation relationships. These links do not display if you view the diagram as a sequence diagram.
When you draw messages between objects in a sequence diagram, each message is represented by its own link line. Messages in sequence diagrams have more editable properties than messages in collaboration diagrams.
Use the following techniques for messages:
- Create a self message
- Reorder a message link
- Specify creation of an object with a message
- Specify destruction of an object with a message
- Specifying a return link by using the Tool Palette
- Specify a return link by using the Object Inspector
To create a self message:
- Click the Self Message button on the Tool Palette.
- For a Sequence diagram, click the lifeline of the object at the point where you want the message to appear. Clicking the object places the message-to-self first on the lifeline.For a Collaboration diagram, click the object.
To reorder a message link:
- Open a diagram.
- To reorder messages, perform one of the following actions:
- Drag message links up and down the object lifeline in the Diagram View. Reordering automatically updates the message link numbers.
- Change the Sequence Number field in the Object Inspector.
- In the Diagram View, use the in-place editor to change the sequence number.
To specify creation of an object with a message:
- Select a message link in the Sequence diagram.
- In the Object Inspector of the message link, click the Creation field.
- Choose True from the list box.
Result: The message link points to the recipient object icon rather than to its lifeline. The created object moves downward along the lifeline to show that it exists at a point later in time from its creator.
By default, the Creation property is set to False in the Object Inspector.
To specify destruction of an object with a message:
- Select a message link in the Sequence diagram.
- In the Object Inspector of the message link, click the Destruction field.
- Choose True from the list box.
Result: The object is destroyed.
By default, the Destruction property is set to False in the Object Inspector.
To specifying a return link by using the Tool Palette :
- Click the Return link button in the Tool Palette.
- On the sequence diagram, click the object lifeline element at the supplier end of the message link to draw the return link.
To specify a return link by using the Object Inspector :
- Select the message link on the sequence diagram.
- Choose View > Object Inspector on the main menu or press F4.
- In the Object Inspector, click the drop-down arrow for the Return Arrow field and select True.