Author Topic: branching in sequence diagrams  (Read 1942 times)

jimp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
branching in sequence diagrams
« on: June 03, 2003, 04:12:43 am »
Is it possible to make the lifeline of an object in an EA sequence diagram fork into two different focus of control regions when a branch results in two different messages being sent to the same object? The lifelines should then merge back after the completion of the alternative actions.

Tjerk

  • EA User
  • **
  • Posts: 228
  • Karma: +1/-0
    • View Profile
Re: branching in sequence diagrams
« Reply #1 on: June 03, 2003, 04:29:10 am »
Hi Jimp,

I don't think this is compliant with the UML standard. It might be for UML realtime / UML 2.0. Maybe you or somebody else could check these (new) standards for the way your situation can be discribed.

Is it that your messages are processed in seperate threads and that these threads are not really running in parallel? Or that synchronisation objects are used? Those situations can be drawn without the artifact you're mentioning.

Greetings,
Tjerk

jimp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: branching in sequence diagrams
« Reply #2 on: June 03, 2003, 05:27:07 am »
Thanks for the reply. I'm actually not talking about anything complicated here - simply something like:

in code for a method of object1...

if (condition)
   object2.method1()
else
   object2.method2()

The lifeline of object2 would fork into two different focus of control regions, depending on what message it got from object1. I've seen diagrams like this in various places, including the OMG UML specification, so I'm assuming that it's a standard kind of thing to do?

Tjerk

  • EA User
  • **
  • Posts: 228
  • Karma: +1/-0
    • View Profile
Re: branching in sequence diagrams
« Reply #3 on: June 03, 2003, 05:36:54 am »
Hi Jimp,

The forking of the message is possible by creating two seperate message and selecting the "Branch with previous message" option in the contextmenu of the second message.

I've personally never seen the split with two vertical branches of an object. So I don't know the UML specs on this feature. If it is UML, then we could ask Sparx to include this.

One possibility is to use the branching of the message as described above. Then drop e.g. two boundary boxes over objects to separate the sequence of method1() from method2().

Greetings,
Tjerk

jimp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: branching in sequence diagrams
« Reply #4 on: June 03, 2003, 06:08:07 am »
Thanks again for the suggestions, Tjerk. The boundary box might be a good way of doing it. Maybe I should be simplifying my sequence diagrams so that they only show one flow through a use case, which would cut down the need for branching. I'll get the hang of this sometime!

I've definitely seen vertical forking in a draft OMG spec and a couple of text books, so maybe it could be included as a feature sometime.

Cheers

Jimp