Reputation: 722
This is a quick basic question of uml. I have a call-to-self, which starts a a loop, that creates some objects. I am wondering if this call-to-self arrow should point inside or outside the loop. I have illustrated the differences here:
Upvotes: 3
Views: 7847
Reputation: 36295
I don't know your tool, but the self call should look like this:
You can see that the loop is inside the self call.
Upvotes: 4
Reputation: 6318
The self call triggering the loop should end outside the loop block.
Each time a loop is executed, its whole block has to be executed. For instance if your self call ends inside the loop block, at each loop iteration the first event should be receiving of a self call. That definitely is not what you want to do as this self call should be received only once (and then start a loop). Thus definitely it has to end outside the loop block.
Upvotes: 1
Reputation: 1396
Since it's not in the loop better place it outside the loop on the diagram. This looks better from both logical and visual perspectives. Better use block on the vertical line to show, for example, that both actions will be in the same transaction or use 2 views, for example one sequence diagram and one activity diagram.
Upvotes: 0