I am trying to create UML sequence diagram for a particular process in our application.
The problem is that most of the business logic is in one class and when I try to map it in sequence diagrams, I am getting multiple calls to the same objects in the sequence diagram.
What I need is a representation similar to a stacktrace in UML sequence diagram. Is it possible using sequence diagram or is some other diagram a better way for representing calls within the same class? Please advise.
A few suggestions:
hth.
Representing a self-call on a UML sequence diagram (see step 7).
If the called method is (or should be) private, then it can safely be excluded from the sequence diagram as an implementation detail.
However I smell the God-Class anti pattern; your class has multiple responsibilities and should be deconstructed. Break down the class so that is has only a single responsibility using delegation. Those method calls would be a good starting point.
It is actually possible to refer to the self instance
In fact UML spec 2.5b1 page 607, about a Lifeline is said: If the name is the keyword self, then the Lifeline represents the object of the classifier that encloses the Interaction that owns the Lifeline. Ports of the encloser may be shown separately even when self is included.
See https://web.archive.org/web/20131101211441/http://lowcoupling.com/post/47844944042/uml-sequence-diagrams for a complete example
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With