I have a question regarding UML sequence diagram. I have actor system, where I have many objects (actors) of the same class communicating with each other. The number of actors depends on the problem, but it is too large to draw them all. I have also other parts of a system (other actors) and now I'm drawing UML sequence diagram showing communication between actors with a time perspective. My question is how to show communication between actors of the same class?
I have found something like this:
But it looks like calling method within object and not other object of the same class (or maybe I'm wrong?). I also thought about showing two objects on diagram, but then I would have to double number of arrows, becouse each communication from other part of system would have to be connected with both. Do you know some third solution how to show this properly?
You could divide your scenario over multiple sequence diagrams.
One diagram has multiple lifelines for the same class, for example
i1 : MyClass
andi2 : MyClass
and shows the interaction between the instances. If another part of the system calls methodbar
of all instances, then you could draw those calls, but what happens inside that method is modeled in a different sequence diagram.For example, here is the first diagram:
and here is the second diagram: