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.
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 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 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 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 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. |
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.
The send event is not blocked and interactions can occur between the point on the sending lifeline and the point on the receiving lifeline.