Chapter 5 Building Dynamic Diagrams


Creating Destroy messages

A message can destroy an object if it is the last message received by the object and you set its Action property to "Destroy".

You cannot destroy an actor or use the destroy action with a recursive message.

A destroyed object lifeline is marked by an X at the intersection point between the object lifeline and the message. The Destroy action ends both activation and object lifeline at this same point.

Note that the Destroy action does not destroy the object, but only represents this destruction in the diagram. The object lifeline ends at a precise point in time; it is not possible to graphically pull the lifeline downwards any more.

There are two possible forms of destroy messages:

Steps To create a Destroy message:

  1. Click the Message tool in the Palette.
  2. Click the lifeline of the sender object or actor and, while holding down the mouse button, drag the cursor towards the lifeline of the receiver object.
  3. Release the mouse button on the lifeline of the receiver, and then double-click the newly created message symbol to display its property sheet.
  4. Select Destroy from the Action list in the Detail tab (this action is not available if the message is not the last message on the receiver lifeline).
  5. Click OK. An X is placed at the intersection point between the Destroy message arrow and the receiver object lifeline.


Steps To create a Self-Destroy message:

  1. Click the Message tool in the Palette.
  2. Click the lifeline of the sender object and, while holding down the mouse button, drag the cursor towards the lifeline of the receiver object.
  3. Release the mouse button on the object symbol of the receiver, and then double-click the newly created message symbol to display its property sheet.
  4. Select Self-Destroy from the Action list in the Detail tab.
  5. Select Return from the Control flow list.
  6. Click OK. The lifeline of the self-destroyed object is marked by an X.


 


Copyright (C) 2006. Sybase Inc. All rights reserved.