Skip to main content

Messages

Messages

Messages represent communication and interaction between different elements in a system. They depict flow of information between components. There are a number of different types of messages, and different ways of notating them within SequenceStack

A message is a command made up of multiple smaller parts. These parts inform the message command of how to behave in the sequence diagram. A message is made up of the following parts:

  • A sender component - This is the component which will be sending the message. The arrow in the sequence diagram will originate from this component, and any messages sent will be assigned to this component in an execution.

  • An arrow (->) - This arrow will initiate the message command, telling the sequence to look for the component before and after the arrow.

  • A receiver component - This is the component that the arrow will be pointing to.

  • (Optional) A message (:) - Adding a colon to the end of a valid message command will append a message to it. Any text that appears after the colon will be added to the arrow in the diagram.

By organizing these elements together, a valid message command will be created. Using this command will allow the sequence diagram to understand how to display the message in the canvas.

Messages Sequence

title: Messages Sequence

actor: Person 1
actor: Person 2

Person 1 -> Person 2: A message

Person 1 --> Person 2: A dashed message

Person 1 -x Person 2: A lost message

Person 1 <-> Person 2: A bidirectional message

Person 1 -> Person 1: A self directed message

Message types

Solid line Message (->)

These types of messages used to represent some information passing between two objects. These types of messages are noted as -> in SequenceStack. Note the direction of the arrow, the arrow used will inform which actor will be sending information, and which will be recieving. Using -> will have a different result to using <-. The arrow will always follow the flow from the sender to the reciever, regardless of the direction of the arrow. Sender->Reciever = Reciever<-Sender.

In order to add text to a message, after the -> and the reciever, include : and write your message afterwards, I.E.: A->B: your message. The A->B is self contained, and any text after the : will only be the message

A -> B: A message

Dashed Message (-->)

These are used to show when a response is returned to an object, to refer to a message that has a time delay, or simply to differentiate a message to be more distinct from other messages. Similarly to solid line messages, the direction of the arrow informs the sender and reciever A-->B.

A --> B 2: A dashed message

Lost Message (-x)

A lost message in a sequence diagram refers to a situation where a message that was expected to be sent between objects within a system is not received properly. This can occur due to many reasons, and in that case a lost message is appropriate. Lost messages can also represent potential points of failure or communication breakdowns in a system. They are notated by -x, or A-xB.

A -x B: A lost message

Bidirectional Message (<->)

In a sequence diagram, bidirectional arrows represent a mutual or two-way message exchange between objects. They indicate that both the sender and the receiver exchange messages with each other, creating a communication flow in both directions. They are notated with A<->B.

A <-> B: A bidirectional message

Self directed Message (A->A)

Represents a message that a component sends to itself. It illustrates a scenario where a component must do something independantly, or inside of itself, which requires it to send a message to itself. It is notated by a message line between a component and itself as both the sender and. A->A

A -> A: A self directed message