Messages

In sequence diagrams, a message is a model element that defines a specific kind of communication between participants in an interaction. A message conveys information from one participant, which is represented by a lifeline, to another participant in an interaction.

A message specifies the sender and receiver, and defines the kind of communication that the execution occurrence dispatches between lifelines. For example, a communication can invoke, or call, an operation using a synchCall or asynchCall, raise a signal using an asynchSignal, and create or destroy a participant.

Sequence diagrams can have three sorts of messages:

A message represents either an operation call or the sending and receiving of a signal. When a message represents an operation, the arguments of the message are the arguments of the CallAction on the sending lifeline and the arguments of the CallEvent on the receiving lifeline. When a message represents a signal, the arguments of the message are the arguments of the SendAction on the sending lifeline and the arguments are available in the SignalEvent on the receiving lifeline. If the message is a synchronous call, a return message typically occurs from the called lifeline to the calling lifeline before the calling lifeline can proceed.

As the following figure illustrates, a message is displayed in an interaction frame as a line with an arrow that points in the direction in which the message is sent; from the sending message end to the receiving message end.

An interaction frame shows a source and target lifeline. A create message spans the source and target lifelines, followed by a synchronous message, an asynchronous message, and a destroy message.

The message that the source lifeline sends to the target lifeline represents an operation that the target lifeline implements. You can name and order messages. The appearance of the line or arrowhead reflects the properties of the message.

Graphic Description Representation
A line with a solid arrowhead points right. A line with a solid arrowhead that points toward the receiving lifeline A synchronous call operation in which the system waits for the flow of control to complete before continuing with the outer flow
A line with an open arrowhead points right. A line with a open arrowhead An asynchronous signal or an asynchronous call in which the source object sends the message and immediately continues with the next step
A dashed line with a solid arrowhead points left. A dashed line with a solid arrowhead that points toward the originating lifeline A return message from a call to a procedure. When you create a synchronous message, a return message is created by default; you can change this default in the Preferences window
You can use two other types of messages in sequence diagrams:

You can identify messages by a name or by an operation signature.

Type Example Description
Name \Get the Password\ A name identifies only the name of the message. Simple names are often used in diagrams that are developed during the analysis phase because the messages are identified by their responsibilities and not operations. One convention places the name in slashes (\\) to indicate that the message name is not associated with an operation. When an operation is associated with a message, the operation name replaces the name.
Signature getPassword When an operation is assigned to a message, you can display the operation signature to identify the name of the operation. Signatures are often used in diagrams that are developed during the design phase because they provide the detail that developers need when they code the design.

Manipulation of asynchronous messages

An asynchronous message is the only message type in which you can individually move the sending point and the receiving point of the message. You can move the points of an asynchronous message between lifelines to manipulate the time delay between the sending event and the receiving event; the result is referred to as a skewed message.

As the following figure illustrates, a skewed message is displayed as a line with an open arrowhead that has multiple interactions that occur between the sending and receiving lifelines.

An interaction frame shows a source and target lifeline. A create message spans the source and target lifelines, followed by an asynchronous message that starts at the source lifeline and vertically crosses two synchronous messages. The message finishes at the target lifeline above a destroy message.

The send event is not blocked and interactions can occur between the point on the sending lifeline and the point on the receiving lifeline.

Related tasks
Creating messages in sequence diagrams
Adding synchronous and asynchronous messages
Adding create and destroy messages
Delaying the receipt of asynchronous messages
Moving synchronous messages
Reordering messages
Deleting messages
Reconnecting messages
Assigning operations to messages

Terms of use | Feedback
(C) Copyright IBM Corporation 2004, 2005. All Rights Reserved.