登录MVC Webapp的顺序图 [英] Sequence Diagram for Login MVC Webapp

查看:362
本文介绍了登录MVC Webapp的顺序图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想制作一个序列图,以显示.Net MVC Web应用程序(即webshop)中的登录过程. 我对UML建模还很陌生,所以我不确定如何在Controller,模型和视图之间建立交互.我在网上找到了不同的解决方案. 这是我有的一些问题:

  1. 客户端是与视图交互还是直接与Controller交互(在我的测试中,客户端与Controller交互)?
  2. 对于loginvalidation:在我的测试试用版中,Controller询问模型,login_data(用户名和密码)是否正确.该模型是否需要与存储用户数据的数据库进行交互?
  3. 如果我想在http请求中发送数据,是否应该在方括号中添加变量?

这是我的测试试用版:

解决方案

这很完美.您只需要缩短http响应并将其移到alt片段之外即可.

  1. 控制器是完成任务"的一种,而视图只是用来呈现它的.实际上,由于视图包含一些基本的I/O逻辑,因此存在一些混杂.但是这里的http数据是从客户端传输到控制器的.
  2. 这取决于.您可以"表明这一点,但您不得".如果模型阅读者需要了解详细信息,则可以直接或在单独的SD中显示.
  3. 您通常会将数据作为方法的参数传递.您还可以显示具体数据(例如,带引号的字符串或整数值).

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:

解决方案

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).

这篇关于登录MVC Webapp的顺序图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆