简体   繁体   English

MVC体系结构:讨论

[英]MVC architecture: discussion

I am creating an application using asp.net MVC. 我正在使用asp.net MVC创建一个应用程序。 By default, the model, view and controller are all in the same project, but can I create different projects or class library projects for the model, view and controller, so I could manage them separately? 默认情况下,模型,视图和控制器都在同一个项目中,但是我可以为模型,视图和控制器创建不同的项目或类库项目,因此可以分别管理它们吗? Is it recommended? 推荐吗?

You definitely can. 你绝对可以。 This part of the point of MVC to allow you to have such flexibility. MVC的这一部分要点让您拥有这种灵活性。 As far as whether it is recommended, it depends on what you are doing. 至于是否建议,取决于您在做什么。 It is not necessity; 这不是必需的; however I think there are definitely many scenarios where it makes sense. 但是我认为肯定有很多情况是有意义的。 Although, this probably makes the most sense for the model. 虽然,这可能对模型最有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM