问题描述
我要决定一个新的大企业应用程序,我们将在未来数年发展,问题是,如果我们应该开始使用MVC 3或Web表单。
I have to decide about a new big business application we will develop in the coming years, the question is if we should start using MVC 3 or web forms.
这已经讨论过这里SO,但我已经看到了这样的问题:ASP.NET MVC准备业务应用(集成第三方控件/组件)?被要求于2008年,现在很多事情可能发生了变化。
This was discussed already here in SO but I have seen the question: ASP.NET MVC ready for business applications (integrating 3rd party controls/components)? was asked in 2008 and now many things could have changed.
我主要关注的是在听取了MVC是良好的呈现网格状或列表,而不是用于数据输入和用户交互的那么好内容。
My main concern is having heard MVC is good for rendering content like grids or lists and not so good for data input and user interaction.
我们的应用程序将有大量的用户在其中的输入数据,并列表和文本框控件工作,检查框等。
Our application will have a lot of controls in which users are entering data and working with lists and text boxes, check boxes and so on.
就是一切完全可能也是在MVC或经典WebForms和视图状态模型会更合适?
is everything absolutely possible also in MVC or the classic Webforms and view state model would be more appropriate?
感谢。
推荐答案
我用的WebForms的每一个版本,因为1.0 beta和MVC 1,2和3,并认为MVC绝对是准备用于生产。
I have used every single version of WebForms since 1.0 beta and MVC 1, 2 and 3 and believe that MVC is definitely ready for production use.
您必须考虑到这2的开发方式是完全不同的:
You must take into consideration that the development approach of the 2 is quite different:
MVC,您需要学习基本的web技术的更低水平的细节:HTML,CSS,JS,HTTP,(我相信你应该无论如何,如果他们不是在你的技能还)。
MVC requires that you learn more low level details of the basic web technologies: HTML, CSS, JS, HTTP, (which I believe you should anyway if they are not in your skill set yet).
的WebForms试图抽象的大部分,可以考虑一些简单的网页拼凑更富有成效。但它是一个漏水的抽象,缺乏可控制阻挠你,你变得更加精通的 - 如果您是新的Web开发之初更加容易;很难弯曲,你获得的经验。
在提高生产率开始消失时,网页变得更加复杂。抽象更有可能导致性能问题和损害自动化您的网页测试(硒或等效的工具既单位和UI级测试)的能力。
WebForms tries to abstract most of it and can be considered more productive for throwing together some simple pages. But it is a leaky abstraction and the lack of control may frustrate you as you grow more proficient - easier in the beginning if you are new to web development; harder to bend as you gain experience.The productivity gains start to disappear when the pages become more complex. The abstraction is more likely to cause performance problems and undermines the ability to automate testing of your pages (both unit and UI level testing with Selenium or equivalent tools).
例1:在MVC中你最有可能将需要了解如何表单字段进行处理,构成通过HTTP POST请求并提供应用程序/格式的URL-CN codeD,否则你可能会用模型绑定斗争。在的WebForms你可以建立大应用,而无需曾经与这一令人担忧的。
Example 1: in MVC you most likely will need to understand how form fields are processed to compose a POST over HTTP with application/form-url-encoded, otherwise you may struggle with model binding. In WebForms you can build big applications without ever worrying with that.
例2:在MVC中,你需要跨请求管理大多数你的页面的状态。在的WebForms很容易有框架为你做。
Example 2: In MVC you need to manage most of your page state across requests. In WebForms it's easy have the framework do it for you.
MVC应用程序往往更依赖于客户端的JavaScript具有可重复使用的部件,结合JSON数据,例如部件。的WebForms鼓励使用服务器端控件,因为他们很好地融入到框架状态管理设施。
MVC applications tend to rely more on client side javascript components for having reusable widgets, binding JSON data for example. WebForms encourages the use of server side controls since they integrate nicely into the framework state management facilities.
不像其他人,我不相信地说,MVC是严格比的WebForms更富有成效。不要低估快速提供数据驱动型业务应用的WebForms能力。已经管理了很多使用这两种人,我的看法是,MVC需要更多熟练的程序员,以提高工作效率。但是,如果这是你的情况下,你可能会发现,MVC是在本领域技术人员手中的更愉快,更强大的平台。
Unlike other people I don't believe in saying that MVC is strictly more productive than WebForms. Don't underestimate the WebForms ability to deliver data driven business applications quickly. Having managed a lot of people using both, my opinion is that MVC requires more skilled programmers to become more productive. But if that is your case you will likely find that MVC is a more enjoyable and powerful platform in those skilled hands.
这篇关于是ASP.NET MVC 3准备业务应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!