如何選擇ASP.NET MVC 和 ASP.NET WEBFORM

來源:互聯網
上載者:User

圖片出處:http://topic.csdn.net/u/20100111/14/36a773b7-8663-4694-a085-274bdd4317d9.html?55591

內容出處:http://blog.sina.com.cn/s/blog_533c03650100dxhh.html

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.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.