Design – Drawing UML activity diagram for user-forget-password functionality

designRequirementsuml

I'm trying to draw a UML activity diagram for the functionality of a user retrieving his password when she has forgotten it. It looks like this:

enter image description here

As you can see, this functionality requires two requests at different stages, one for the input of the username, the other for the input of the verification code. So the whole procedure could be divided into two sub-procedures each representing a single request and response pair. That's why I wonder whether I should use one or two activity diagrams to illustrate this functionality. Should an activity diagram correspond to a single functionality or to a single request/response pair?

In my opinion, the former one brings completeness, but increases complexity. The complexity could be solved by the latter one, but it also brings partition and dependency issues. It's hard to decide for me, please give me some suggestions.

Best Answer

Using one or two diagrams depends on what you want to show:

  1. The behaviour of the whole functionality
  2. What the system should do when a certain request comes in

For me it seems logical to make one activity diagram of the whole functionality. Then if you feel the need to go into details of what the system does when receiving a certain request, do nr 2 also. Maybe then a sequence diagram would be the apropriate level, as you want to show the request and which entities (e.g. java classes) will participate in processing it. In this case, maybe you could write the code without making a diagram, but as a practice you can make a simple sequence diagram to see the differences between activity and sequence diagram and how they relate. Happy learning! :-)

Related Topic