Tuesday 3 June 2014

Who Should Use ASP.NET MVC?


  • As with any new technology, the fact of ASP.NET MVC’s existence isn’t a compelling reason to adopt it.
  • Here, we’ll give you our view of how the MVC Framework compares with the most obvious alternatives.
  • We’ve tried to be as unbiased as two people writing a book about the MVC Framework can be, but we know that there is a limit to our objectivity. The following sections are technology-based comparisons.
  • When selecting a web application framework, you should also consider the skills of your team, the work involved in porting any existing projects, and your relationship with, and confidence in, the technology source.


Comparisons with ASP.NET Web Forms
We have already detailed the weaknesses and limitations in traditional ASP.NET Web Forms, and how ASP.NET MVC overcomes many of those problems. That doesn’t mean that Web Forms is dead, though.
Microsoft has repeatedly stated that both technologies are being actively developed and actively supported, and that there are no plans to retire Web Forms. In some ways, your choice between the two is a matter of development philosophy. 

Consider these points:

  • Web Forms takes the view that UIs should be stateful, and to that end, adds a sophisticated abstraction layer on top of HTTP and HTML, using View State and postbacks to create the effect of statefulness. 
  • This makes it suitable for drag-anddrop Windows Forms–style development, in which you pull UI widgets onto a canvas and fill in code for their event handlers.
  • MVC embraces HTTP’s true stateless nature, working with it rather than fighting against it. 
  • The MVC Framework requires you to understand how web applications actually work. 
  • Given that understanding, it provides a simple, powerful,  modern approach to writing web applications, with tidy code that’s easier to extend and maintain over time, and that’s free of bizarre complications and painful limitations. 
  • There are certainly cases where Web Forms is at least as good as, and probably better than, MVC.
  • The obvious example is small, intranet-type applications that are largely about binding grids directly to database tables or stepping users through a wizard. 
  • Web Forms drag-and-drop development strengths can outweigh its weaknesses when you don’t need to worry about bandwidth consumption or search engine optimization.
  • If, on the other hand, you are writing applications for the Internet or larger intranet applications, you will be attracted by the bandwidth efficiency, better browser compatibility, and better support for automated testing that MVC offers.

No comments:

Post a Comment