2

Has anyone used message branching in sequence diagrams? Does anyone know what this is specifically used for?

To the best of my understanding it is used to show a single message being received by multiple recipients

Diagram showing a message branching to two recipients

I have just seen it used to show concurrency, but I think that is incorrect and should be described by a "par" fragment or inside a co-region.

diagram showing a message branching to one recipient

Thoughts and opinions?

Peter Uhnak
  • 9,617
  • 5
  • 38
  • 51
  • Never seen that. What is your source? – qwerty_so Mar 17 '16 at 13:17
  • We're creating sequence diagrams for a project and one of my colleagues had created the second diagram to show a single action spawning multiple messages. The problem is that I am having trouble finding good literature on message branching. I've seen a couple of sources and they all seem to suggest that it should be used to show different messages being sent based on conditions but they haven't got any examples and aren't too clear. – Richard Clubb Mar 17 '16 at 13:20

1 Answers1

5

UML 2+

As far as I know there's no such thing as message branching in sequence diagrams in UML 2+ (but see the end).

To begin with, a Message is a pair of sendEvent and receiveEvent, where both the sendEvent (for foundMessage) and receiveEvent (for lostMessage) can be optional, but it cannot have multiple senders/receivers.

enter image description here

If anything, your diagram would be two different message sends, because if you have two receivers, then each one presents a different receiveEvent (and therefore a unique Message).

Furthermore the notation you've used is odd, because [emphasis mine]

In an interaction diagram each vertical line describes the time-line for a process, where time increases down the page. The distance between two events on a time-line does not represent any literal measurement of time, only that non-zero time has passed.

so the non-horizontal line means non-zero time interval, and the spec doesn't make a mention of such bent lines.

UML 1.3 (<2)

I've found message branching in UML 1.3 (http://doc.omg.org/formal/2000-03-01.pdf)

Variation: Branching

A branch is shown by multiple arrows leaving a single point, each labeled by a guard condition. Depending on whether the guard conditions are mutually exclusive, the construct may represent conditionality or concurrency.

However UML 1.3 doesn't have a well-defined metamodel.

Summary

As far as I can tell, message branching was dropped from the specifications starting from UML 2. It can however be represented by two separate messages with well-defined Ordering, or by using par fragment if it is parallel (which is not the same thing).

Peter Uhnak
  • 9,617
  • 5
  • 38
  • 51