1

hi everyone i'm à newbie in uml and my question is simple:i want to draw a sequence diagram for members login and the steps are as follows:


the member visits the login page

enters email/pwd

clicks login

then the system goes to the database

if record exists

if account active

  display login success msg 

else (account not active)

  display error msg

else(record does not exists)

display error msg


and the diagram should contains the following objects:

  • member

  • login page

  • System

  • database

so can any one show me how it's done and thanks in advance.

Joseph
  • 1,458
  • 15
  • 20

1 Answers1

3

The best is simply not to use a sequence diagram for things which are better expressed in code like if and loop. However, if there is a need for it, use fragments and put the according sections inside.

See here for examples.

Your case will start looking like this:

enter image description here

qwerty_so
  • 35,448
  • 8
  • 62
  • 86
  • i know how to use one if else statement but ... what i dont know is how to nest two if else statements together and yes there is a need for a sequence diagram in my case. – Joseph Apr 30 '15 at 12:06
  • Simply nest the fragments. That's all. As said: the graphical representation does not really add value. It's much simpler to express that with code. – qwerty_so Apr 30 '15 at 12:33
  • can you please just provide a picture that demonstrates my case and it doesn't have be a login cas just any sequence diagram with nested if else and thanks in advance. – Joseph Apr 30 '15 at 12:44
  • No problem. Earning points by exchanging knowledge is one thing that drives SO :-) – qwerty_so May 01 '15 at 08:46
  • what was that drawn with? – Ian Vaughan Jun 23 '22 at 06:49
  • @IanVaughan Enterprise Architect. I have mixed feelings about this product. But most likely it's not the worst choice. – qwerty_so Jun 23 '22 at 08:03