什么是MVC的替代品? [英] What's an alternative to MVC?

查看:131
本文介绍了什么是MVC的替代品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看起来像我所使用的每个项目都使用模型视图控制器架构,这就是我自己的项目。有办法吗创建具有持久存储和用户界面的应用程序又如何?

Seems like every project I'm on uses a Model View Controller architecture, and that's how I roll my own projects. Is there an alternative? How else would one create an application that has persistent storage and a user interface?

推荐答案

MVC 已经有一段时间了。这是经过时间测试和验证的模式。许多框架利用了 MVC模式。 Martin Fowler已将MVC解构为:监督演示者被动视图

MVC has been around for a while. It's a time tested and proven pattern. Many frameworks leverage the MVC Pattern. Martin Fowler has deconstructed the MVC into: Supervising Presenter and Passive View.

架构师 Christopher Alexander 说最好的:


每个模式都描述了一个问题,

环境中反复出现,然后描述
核心的解决方案,
这样一种方式,你可以使用这个
解决方案百万次,没有
以同样的方式两次。

Each pattern describes a problem which occurs over and over again in our environment and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.

我不知道为什么要从MVC移动。有没有问题你遇到MVC没有雄辩地解决?要给您一个更好的答案,我们需要了解更多关于您的问题域

I'm not sure why you would want to move from MVC. Is there a problem you are encountering that MVC does not eloquently solve? To give you a better answer we need to know more about your problem domain.

需要考虑的事项当考虑模式/架构时:如果您使用 Myspace 类型架构构建内容您将需要一个强大的架构(MVC)。如果您正在通过网络创建一个简单的crud界面 - 几乎任何事情都会做。

Things to take into account when considering patterns/architecture: If you are building something with a Myspace type architecture you'll need a robust architecture (MVC). If you are creating a simple crud interface via the web - almost anything will do.

对于.Net Web表单(我假设网络,因为你没有说厚或Web客户端),而不是MVC,这是一场维护他们的恶梦。生活更多的Web Forms应用程序,几年往往成为大球泥浆。即使这样,开发人员也发现了使用具有Web表单的MVC 的方法。

For .Net Web forms (I am assuming web, since you didn't say thick or web client) which is not MVC, it was a nightmare maintaining them. Web Forms applications that lived more that a couple years tended to become big balls of mud. Even then developers discovered ways to use MVC with web forms.

讽刺的是,ASP.NET Web表单中缺少MVC架构是导致开发 ASP.Net MVC框架

Ironically, the lack of MVC architecture in ASP.NET web forms was one of the driving complaints that lead to the development of ASP.Net MVC framework.

从经验来看,如果您不使用某些MVCesk方法,您的解决方案将变得难以维护和blo肿。这些应用程序将死亡缓慢的痛苦死亡。

From experience if you don't use some MVCesk approach, your solutions become hard to maintain and bloated. These applications will die a slow painful death.

如果您的解决方案是小型一次性项目,一切都会把东西放在一起。哎,有些工具可以从屏幕到数据访问层产生一切。无论做什么来完成这项工作。

If your solutions are small one-off projects, the by all means throw something together. Heck there are tools that will generate everything from the screens to the data access layer. Whatever works to get the job done.

这篇关于什么是MVC的替代品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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