Olcay Tarazan
Olcay Tarazan

Reputation: 961

Should I show inheritence in Sequence Diagram

Do I need to show the different implementation of classes in a sequence diagram? I am trying to keep it simple.Therefore,should I hide different implementation in order to keep it generic? Or I should show a use case with one possible implementation or it depends? :)

enter image description here

Upvotes: 1

Views: 3199

Answers (2)

baneen
baneen

Reputation: 1

The concept of inheritance doesn't totally lie in the sequence diagram.
The sequence diagram shows object life line and objects used according to your project.
If you want inheritance, you should use class diagram, aggregation and composition to show it.

Upvotes: 0

qwerty_so
qwerty_so

Reputation: 36313

As the comment already said: a SD does not tell anything about inheritance. This is a purely statical aspect which you can show in class diagrams.

As to whether show different implementations: it depends. Given you have multiple collaborations which realize a single use case (e.g. if you have multiple product lines or options in a product) you might wish to show the different behavior in different SD. But likely just only if there are variants between the different implementations. If you have a general path you would show that only once and reference it from the other collaborations.

Upvotes: 3

Related Questions