Search code examples
umlsequence-diagram

What are Non-instantaneous and Duration messages in Sequence Diagram


I am trying to understand Non-instantaneous and Duration messages in the Sequence Diagram. I looked at Visual Paradigm but I could not understand: are they asynchronous messages or something else?

Here the explanation I could find so far:


Solution

  • Timing in sequence diagrams

    In sequence diagrams, messages are generally represented with horizontal-lines ended with an arrow. This notation does not say anything about differences in time between the sending and the receiving of message: the reception can be immediate ("instantaneous") or it can be take some time.

    When time is relevant for a specific sequence, it can be described:

    • with a duration observation, that tells for a horizontal message line the duration it takes for the message being sent.
    • with a time observation, that tells something about the time at the point where a message meets a lifeline.
    • with a duration contraint that documents graphically on the vertical axis a constraint about the difference between two time observations
    • with a time constraint that documents some constraints for a time on the lifeline.
    • graphically, with an oblique message line that suggests visually a difference in time between the sending and the receiving of some messages. This means that there is a duration to be taken into account for the sending of the message. This duration is not necessarily precisely documented. It can also be denoted as “{delay}.”

    The first and the last cases correspond to non-instantaneous messages, i.e. messages that take time for being received.

    Timing an synchrony

    Instantaneousness shall not be confused with synchrony:

    • graphically, synchronous messages are always drawn with a plain arrow head. This means that the sender waits for the answer before doing something else. A message can be non-instantaneous but nevertheless synchronous if the sender waits for the reply. We can deduce that the order of sending from a given lifeline is the same as the order of receiving on the receiving lifeline.
    • graphically asynchronous messages are always drawn with an open arrow head. This means that the sender continues to execute without first waiting for the reply from the receiver. In these circumstances, it is possible that message delays cause messages to be received in a different order. This is shown on the graph with two crossing messages.