Choosing between ASP.NET MVC and ASP.NET Webforms
2009-06-18 16:47
429 查看
Choosing between ASP.NET MVC and ASP.NET Webforms
In general, choosing between ASP.NET MVC and ASP.NET can be based on the following five criteria:
1. Are you considering test-driven development (TDD)?
TDD enables you to write tests for an application first, after which the application logic is developed. An ASP.NET Webforms application uses only one class to display output and handle user input. Automated testing of this class is complex as you are required to load the full ASP.NET stack into a separate process (for example, in IIS). The MVC framework allows the testing of each component separately, without requiring the full ASP.NET stack. For example, you can test your model separately from your controller without requiring a view. If you are considering TDD, the ASP.NET MVC framework will be the better choice.
2. Is there a need for fine control over HTML markup?
ASP.NET Webforms automatically inserts hidden HTML markup, IDs, JavaScript, and so on, into your page's HTML output because of its
event‑driven architecture and its use of ViewState. The ASP.NET MVC framework allows for 100% control over the HTML output. If you require full control over your HTML markup, the ASP.NET MVC framework will be the better choice.
3. Is the application heavily data-driven?
If you are developing an application that is heavily data-driven and is using grids or a lot of master-detail editing of data, ASP.NET Webforms may be the better choice as it provides a lot of controls that will aid you in the development of these kind of applications. Of course, you can use the ASP.NET MVC framework for these tasks too, but you will be required to write more code to achieve the same goal.
4. Is there a need for a Winforms-like development approach?
Does your development team write Winforms code? Is there a need for an event-driven programming approach? In these cases, consider ASP.NET Webforms in favor of ASP.NET MVC.
5. Is there a need for a rapid application development (RAD) development approach?
Does your client expect a quick prototype of an application? Is the use of drag-and-drop development using pre-created web controls required? If so, consider ASP.NET Webforms in favor of ASP.NET MVC.
In general, choosing between ASP.NET MVC and ASP.NET can be based on the following five criteria:
1. Are you considering test-driven development (TDD)?
TDD enables you to write tests for an application first, after which the application logic is developed. An ASP.NET Webforms application uses only one class to display output and handle user input. Automated testing of this class is complex as you are required to load the full ASP.NET stack into a separate process (for example, in IIS). The MVC framework allows the testing of each component separately, without requiring the full ASP.NET stack. For example, you can test your model separately from your controller without requiring a view. If you are considering TDD, the ASP.NET MVC framework will be the better choice.
2. Is there a need for fine control over HTML markup?
ASP.NET Webforms automatically inserts hidden HTML markup, IDs, JavaScript, and so on, into your page's HTML output because of its
event‑driven architecture and its use of ViewState. The ASP.NET MVC framework allows for 100% control over the HTML output. If you require full control over your HTML markup, the ASP.NET MVC framework will be the better choice.
3. Is the application heavily data-driven?
If you are developing an application that is heavily data-driven and is using grids or a lot of master-detail editing of data, ASP.NET Webforms may be the better choice as it provides a lot of controls that will aid you in the development of these kind of applications. Of course, you can use the ASP.NET MVC framework for these tasks too, but you will be required to write more code to achieve the same goal.
4. Is there a need for a Winforms-like development approach?
Does your development team write Winforms code? Is there a need for an event-driven programming approach? In these cases, consider ASP.NET Webforms in favor of ASP.NET MVC.
5. Is there a need for a rapid application development (RAD) development approach?
Does your client expect a quick prototype of an application? Is the use of drag-and-drop development using pre-created web controls required? If so, consider ASP.NET Webforms in favor of ASP.NET MVC.
相关文章推荐
- Mixing ASP.NET Webforms and ASP.NET MVC
- Mixing ASP.NET MVC and Webforms
- Asp.NET MVC and Asp.NET WebForms Features
- ASP.NET WebForms and MVC together in one project
- Plug-In Hybrids: ASP.NET WebForms and ASP.MVC and ASP.NET Dynamic Data Side By Side
- 【引】Difference between Asp.Net WebForm and Asp.Net MVC
- Test your ASP.NET MVC or WebForms Application on IIS 7 in 30 seconds
- [转]ASP.NET AJAX and Sys.Webforms.PageRequestManagerServerErrorException
- How to pass javascript complex object to ASP.NET Web Api and MVC
- Asp.Net Web Forms/MVC/Console App中使用Autofac
- 在 ASP.NET WebForms/MVC 中利用 HttpModule 添加全局站点统计(CNZZ、百度统计、Google Analytics等)脚本
- Asp.Net MVC framework And Asp.Net Webform
- Introduction to ASP.NET and Web Forms
- HTML5, jQuery Mobile and ASP.NET MVC 4 – Using the ViewModel between the model and controller
- Asp.Net Web Forms/MVC/Console App中使用Autofac
- ASP.NET MVC with Entity Framework and CSS一书翻译系列文章之第一章:创建基本的MVC Web站点
- Creating a NuGet Package in 7 easy steps - Plus using NuGet to integrate ASP.NET MVC 3 into existing Web Forms applications
- ASP.NET WebForm and ASP.NET MVC
- \t\tAsp.net MVC VS Asp.net WebForms
- Create an Asp.Net Web Forms Application using Bootstrap and Web API