Search code examples
sequence-diagram

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


Solution

  • 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.