Sequence Diagram for Login MVC Webapp

2019-08-14 04:43发布

问题:

i want to make a sequence diagram, which shows the login process in an .Net MVC Webapp (i.e. webshop). I am quite new to UML modeling, so i am not sure, how to build the interaction between, Controller, model and view. I found different solution online. Here are some question i have:

  1. Does the client interact with the view, or directly with the Controller (in my test Trial the client interacts with the Controller)?
  2. For the loginvalidation: In my test Trial the Controller ask the model, if the login_data (username and pw) are correct. Is it necessary, that the model interacts with an database, where the user data are stored?
  3. If i would like to send data in an http Request, should i just add the variable in the brackets?

Here is my test Trial:

回答1:

This is perfect. You just could shortcut the http-response and move it outside the alt fragment.

  1. The controller is the one to "do the job" and the view just to present it. Actually there's a bit of intermix since views contain some basic I/O logic. But here the http-data travel from the client to the controller.
  2. It depends. You "can" show that but you "must not". If the model reader needs to know the details you can show that directly or in a separate SD.
  3. You would usually pass data as parameter of a method. You can also show concrete data (e.g. a quoted string or an integer value).