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:
- Destroy message
- Self-Destroy message
To create a Destroy message:
- Click the Message tool in the Palette.
- 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.
- Release the mouse button on the lifeline of the receiver, and then double-click the newly created message symbol to display its property sheet.
- 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).
- Click OK. An X is placed at the intersection point between the Destroy message arrow and the receiver object lifeline.
To create a Self-Destroy message:
- Click the Message tool in the Palette.
- Click the lifeline of the sender object and, while holding down the mouse button, drag the cursor towards the lifeline of the receiver object.
- 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.
- Select Self-Destroy from the Action list in the Detail tab.
- Select Return from the Control flow list.
- Click OK. The lifeline of the self-destroyed object is marked by an X.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|