laravel UML类图上的Laravel MVC应用结构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30739864/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:44:46  来源:igfitidea点击:

Laravel MVC application structure on UML class diagram

phplaravelmodel-view-controllerumlclass-diagram

提问by Mike

As shown in many examples, MVC architecture involves three classes - Model, View and Controller respectively. With this, it is simple to show MVC on UML class diagram. However, in Laravel the view is not a class directly, it is a page. Can you please tell me, how to display a such a view on UML class diagram properly? (or, if there is no way, on another UML diagram)

如许多示例所示,MVC 架构分别涉及三个类——模型、视图和控制器。这样,在 UML 类图上显示 MVC 就很简单了。但是,在 Laravel 中,视图不是直接的类,而是页面。你能告诉我,如何在 UML 类图上正确显示这样的视图吗?(或者,如果没有办法,在另一个 UML 图上)

EditMy current attempt looks like this: enter image description here

编辑我当前的尝试如下所示:在此处输入图片说明

回答by qwerty_so

You can simply present a view as a class. Dialog elements can be shown as attributes having types that can be either simple strings (for input fields) or other classes that represent e.g. drop down.

您可以简单地将视图呈现为类。对话框元素可以显示为具有类型的属性,这些属性可以是简单的字符串(用于输入字段)或其他表示例如下拉列表的类。

EditYour diagram looks ok. Just add the attributes for the view like

编辑您的图表看起来不错。只需为视图添加属性,如

+email:Text
+password:HiddenText
+name:String
+OK:Button

etc.

等等。