Question

Is it possible to represent this case on a sequence diagram? If yes, how? Is the newly created object represented as an absolutely new object?

Thank you for reading and replying !

Was it helpful?

Solution

The simplest answer is yes. If it's a new object, it's a new object. Different from the other one. It may have the same name but it has different identity. So it just becomes a new object with its own lifeline on the sequence diagram.

hth.

OTHER TIPS

When an object is destroyed its lifeline is also destroyed which means it is non-existent after that, so you can obviously create a new object with that name.But try to avoid creating objects with same name which run in parallel because that will invoke conflicts.Creating objects with the name of a persistent object may also give rise to conflicts.To represent it on a sequence diagram just draw an object with its own lifeline.Make sure to start the interactions after the previous object's "destruction".

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top