3

Given the following sequence diagram, how to express the equivalent in a UML communication diagram?

enter image description here

Edit This is slightly different from How to express loops in Communication Diagrams? because there are two messages in the loop.

I see the link to http://www.smartdraw.com/resources/tutorials/uml-collaboration-diagrams/ which mentions the * for a loop.

Would it be right then to use:

1 * [i=1..5] : hello
2 * [i=1..5] : bye

The trouble I see is that this seems to be ambiguous: is it hello x 5 then bye x 5, or (hello bye) x 5.

Community
  • 1
  • 1
Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111

2 Answers2

4

Try to aggregate them. Introduce these instead:

1 * [i=1..5] : hellobye
1.1 : hello
1.2 : bye
Tisho
  • 8,320
  • 6
  • 44
  • 52
  • The messages hello (1.1) and bye (1.2) would originate from the destination of hellobye (1), which seems to be Alice (that would be wrong). It would only make sense if you're saying hellobye is a message from Bob to Bob. That's creative, but I don't think it's the standard solution I was looking for. – Fuhrmanator Jul 18 '12 at 21:43
-1

I don't think it can be done. The whole idea of collaboration diagrams is to use them when you have simple object interaction. Why not use a sequence diagram?

vainolo
  • 6,907
  • 4
  • 24
  • 47
  • *"The whole idea of collaboration diagrams is to use them when you have simple object interaction."* Not sure I agree with that statement. However, after such a long time with no answer, I'm willing to accept that the standard doesn't make this clear. – Fuhrmanator Jul 04 '12 at 00:55