何时为MVC架构添加新模型? [英] When to add a new model for MVC architecture?

查看:100
本文介绍了何时为MVC架构添加新模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用MVC模式时,您在决定何时添加新模型以及何时添加新控制器时遵循什么标准?例如,我希望建立一个拥有基本社交网络,然后是5到10个应用程序的网站。我将所有数据存储在Azure表存储中,除了图像,文件和视频,我存储在Azure博客存储中。我希望整个网站有大约100页,社交网络和应用程序。我应该为整个项目使用一个模型和控制器,只是添加不同的视图,或者我应该为每个应用程序使用不同的模型和控制器。

解决方案

实际上模型完全取决于你的架构,你应该根据需求设计你的模型,但作为一个简短的描述可能不是每个模型反映数据库实体的错误句子

检查链接,我希望它有所帮助:



在7天内逐步学习MVC(模型视图控制器) - 第1天 [ ^ ]



模型 - 视图 - 控制器(MVC)模式用C#/ WinForms [ ^ ]

When using the MVC pattern, what criteria do you follow in deciding when to add a new model and when to add a new controller? For example, I am looking to build a website that has basic social networking and then 5 to 10 applications. I am storing all of the data in Azure table storage except images, files and videos, which I am storing in Azure blog storage. I expect to have about 100 pages for the whole website, with social networking plus the apps. Should I use one model and controller for the whole project and just add different views, or should I have a different model and controller for each application.

解决方案

In fact the models are completely depends on your architecture,and you should design your models base on requirement, but as a brief description maybe it's not a wrong sentence that each model is reflecting a database entity
check the links, I hope it helps:

Learn MVC (Model View Controller) step by step in 7 days – Day 1[^]

The Model-View-Controller(MVC) Pattern with C#/WinForms[^]


这篇关于何时为MVC架构添加新模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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