Search code examples
umlvisual-paradigm

Sequence Diagram for Login Operation


It's my first time working with visual paradigm and uml in general and I'm a bit confused about how I'm supposed to show certain behaviours. I wish to draw a sequence diagram for a very classic login operation on a web site: first the user submit a form with a username and a password, the controller check if there is a registered user with that username(1) and then see if the submitted password match the one saved for the user. If the answer is "yes" then an "ok" signal is send to the now logged in user(2)(a different entity that the one which started the operation) otherwise a "wrong password" response is sent to the original user(3). Three "wrong password" signal cause a security procedure that block any login attempt for 12 hours(4)

This is what I managed to create

enter image description here

I'm myself very dubious that this goes anywhere near what I'm trying to describe, first of all (1) should be a termination point,the procedure must be restarted by the user, and I can't see how this is shown in the diagram, the same is true for (3), how can I state that the only right flow of events is 1.1, 1.3, 1.4? At (2) I've used an entity lifeline because I couldn't manage to find a way to add a message from a lifeline to an entity, in truth I've found that I can't add any kind of messages at all using the sequence tool menu, it only works if I use the recource catalog,to add the second response message I had to duplicate the first and rename it. Now the harderdest part, how do I model (4)? Loop doesn't seems right, cause it's not 3 iteration in the same instance of the procedure but three message of the same kind received after a sequence of three different istances.

tl;dr How do I establish a solid order in the actions and how I do show that there is a branch where only one of the two options is avaliable? How (4) can be modeled?


Solution

  • That does not look to bad. You probably need to nest the 2nd alt into the first to make it correct. You can also add [guards] to describe the condition for the alt parts.

    However, as you experience, the graphical SD approach is not necessarily the best. Often it's easier to describe such things with a pseudo language and I recommend do that. SDs are nice to get an overview of objects that collaborate in a scenario. But for algorithmic details any textual (pseudo program) description is better suited.