Chapter 5 Building Dynamic Diagrams


Message property sheet Detail tab

The Detail tab in the message property sheet includes the following properties:

Property Description
Action Specifies the type of message action. You can choose between:

  • Create – the sender object instantiates and initializes the receiver object. A message with a create action is the first message between a sender and a receiver.
  • Destroy – the sender object destroys the receiver object. A large X is displayed on the lifeline of the receiver object. A message with a destroy action is the last message between a sender and a receiver.
  • Self-Destroy – (only available if the control flow property is set to "Return") the sender object warns the receiver object that it is destroying itself. A large X is displayed on the lifeline of the sender object. A message with a self-destroy action is the last message between a sender and a receiver.
Control flow Specifies the mode in which messages are sent. You can choose between:

  • Asynchronous – the sending object does not wait for a result, it can do something else in parallel. No-wait semantics
  • Procedure Call – Call of a procedure. The sequence is complete before the next sequence resumes. The sender must wait for a response or the end of the activation. Wait semantics
  • Return – Generally associated with a Procedure Call. The Return arrow may be omitted as it is implicit at the end of an activation
  • Undefined – No control flow defined
Operation Links the message to an operation of a class. If the receiver of a message is an object, and the object has a class, the message, as a dynamic flow of information, invokes an operation. You can therefore link a message to an existing operation of a class but also operations defined on parent classes, or you can create an operation from the Operation list in the message property sheet.

If an operation is linked to a message, you can replace the message name with the name of the method that one object is asking the other to invoke. This process can be very useful during implementation. To display the name of the operation instead of the name of the message, select the Replace by Operation Name display preference in the message category.

You can link a Create message to a Constructor operation of a class if you wish to further detail a relation between a message and an operation. You are not allowed however to link a message with a Return control flow to an operation.

If you change the generalization that exists between classes, the operation that is linked to the message may no longer be available. In this case, the operation is automatically detached from the message. The same occurs when you reverse the message direction, unless the new receiver object has the same class.

For more information on linking a message to an operation, see the "Linking a message to an operation section", in the "Working with Object-Oriented Models" chapter.
Arguments Arguments of the operation
Return value Function return value stored in a variable and likely to be used by other functions
Predecessor list Made of a list of sequence numbers followed by "/ ", the predecessor list defines which messages must be exchanged before the current message could be sent.
Example: sequence numbers 1, 2, 4 before 3 = "1,2,4/ 3"
Condition Condition attached to the message. May be specified by placing Boolean expressions in braces on the diagram.
Example: condition for timing: [dialing time < 30 sec]
Begin time User-defined time alias, used for defining constraints.
Example: Begin time = t1, End time = t2, constraint = {t2 - t1 < 30 sec}
End time User-defined time alias, used for defining constraints.
Support delay Specifies that the message may have duration. The message symbol may slant downwards.

If this option is not selected, the message is instantaneous, or fast, and the message symbol is horizontal.

You can specify Support delay as a default option in the Model Options dialog box.

Support delay is not available with a recursive message: it is selected and grayed out.

Control flow

By default, a message has an Undefined control flow.

If you want to make a diagram more readable, you can draw the Return arrow to show the exact time when the action is returned back to the sender. It is an explicit return that results in returning a value to its origin.

In the example below, the explicit Return causes values to be passed back to the original activation.


You can combine message control flows and message actions according to the following table:

Control flow Symbol No action Create Destroy Self-Destroy
Asynchronous
     
Procedure Call
     
Return
   
Undefined
     

= allowed

— = not allowed

Note   Accessing Action and Control flow values
You can access the Action and Control flow values of a message by right clicking the message symbol in the diagram, and selecting Action/Control flow from the contextual menu.

 


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