2
votes

Imagine that a program spawns multiple threads to do the same kind of sequences interacting with different versions of objects. How do I model this in a sequence diagram?

Say a thread is being replicated n number of times and this thread then performs some operations with objects A,B and C n number of times. How does one show it in a sequence diagram?

1
different versions of objects you mean different instances of the same classes ? The executions are done in parallel very probably ?bruno
I was not able to edit my content but what I wanted was, say a thread is being replicated n number of times and this thread then performs some operations with objects A,B and C n number of times. How does one show it in a sequence diagram?Vipul Kandivalikar

1 Answers

4
votes

Simply show the spawning of the sub-processes and nothing else in a first diagram. Then create a 2nd diagram showing the details for what happens in one of the threads. Now you only need some textual description (a note) which links both diagrams. Alternatively you can drop the detail diagram as Interaction Occurence onto the lifelines of the single threads.

enter image description here