How to Represent Async Response in UML Sequence Diagram

sequence-diagramuml

If A sends an async message to B like for example, to load async images to UI from the web. Where should the response message go?

Should it be slant as well or direct? And where would the activation of the sender (A) would be?

enter image description here

Best Answer

There are two questions here: 1. The slanting of the arrow(s) and 2. what to do with the activation.

  1. The arrows should be slanted if you want to represent in your diagram that it takes time for the message to travel from A to B or vice-versa.
    If you just want to indicate that the message is processed a-synchronously, it is enough to use an open arrow-head on the message.

  2. When a message (sent from A to B) is processed a-synchronously, then the activation of A ends as soon as the message has been sent and starts again when the response from B is received.
    This is under the assumption that A does not block while waiting for the response, but it would be able to do some other processing while waiting for the response.

Related Topic