Search code examples
umluse-casesequence-diagram

Do you have to put extend in a sequence diagram?


I wanted to know if you have to put an extend in a sequence diagram. Let's say I have a use case diagram for registration. I have included an extend which is re enter password. Does that have to be in a sequence diagram or do I not put it in?

Thanks


Solution

  • There is already qwerty_so's excellent answer. I'd nevertheless like to add some information:

    • An UML diagram does not have to represent the full system with all the details. YOU decide what you want to show. Your model is your story to explain the design.
    • Usually, some diagrams shows the big picture, and other diagrams focus on the relevant details. Because putting everything on one diagram makes it very difficult to read.
    • The UC diagram shall focus on what matters to the user: browsing a catalog, purchasing a film, checkout the cart,... It should show things that the user is interested in. Personally, I don't know many users that are genuinely interested in entering or re-entering passwords. Therefore it should not appear on an UC diagram (except if it's for school and the teacher was mislead in asking you to do so).
    • The UC diagram should not represent the user interface. Ivar Jacobson, the creator of UC, has repeated it many times and even documented it in a book: UC is not good for modelling user interface interactions; other techniques are more suitable.
    • If you transform a UC into a class diagram or a sequence diagram, you probably would end up with ECB. So 1 UC would mean at least 2 participants in the sequence diagram. 2 UC means at least 4 participants. It'd be already a very detailed diagram with many interactions. Yes, you can. But maybe it'll be more readble to have a first SD focusing on the real UC that add value for the user. A second SD may then focus on the detailed interactions for the re-entering of password, without showing all the details of the main SD. Each SD would then be easier to digest.