It’s said “ASP.NET MVC Framework” is the biggest innovation in Microsoft web development since ASP.NET 1.0″. Eventhough techies are of the view that APS.NET WebForms programming is here to stay many have started predicting its replacement with MVC within a year or so. Let me quote Jeffrey Palermo, author of “ASP.NET MVC in Action” – “For the .NET industry as a whole, I predict that ASP.NET MVC will be considered the norm for ASP.NET development by 2011”.
Questions like MVC or WebForms are dying; instead questions appearing nowadays are MVC or SharePoint. Check this http://odetocode.com/Blogs/scott/archive/2009/10/29/mvc-or-web-forms-a-dying-question.aspx
With so much of support of MVC, I also thought to implement my new project based on .net MVC Framework, so I jumped into various MVC tutorials, books, communities etc. And after about a week of research and working on sample project, I concluded to stay with WebForms until I am out the roadblocks I could perceive at this time. Eventhough I am going though rough patch due to my dad’s health, I didn’t stopped researching “Why MVC” using my smartphone, laptop etc.
I thought to share my research and path to conclusion which may help some of you guys.
Here it is:
MVC certainly has edge as far as technology and architecture is concerned, here are some those advantages of using MVC with ASP.NET instead of WebForms
- Provides fine control over rendered HTML, Cleaner generated HTML.
- Complexity of application logic is made easier to manage because of the separation of an application into model, view, and controller.
- It allows for easier parallel development; each developer can work on a separate component of the MVC pattern.
- It provides good support for TDD, mocking, and unit testing frameworks. TDD enables you to write tests for an application first, after which the application logic is developed. TDD, mocking, and unit testing are explained in Chapter 9, Testing an Application.
- It does not use ViewState or server-based forms, which allows you to have full control over the application’s behavior and HTML markup.
- It uses RESTful interfaces for URLs, which is better for SEO (Search Engine Optimization). REST is short for REpresentational State Transfer—the concept of using URLs as the link to a resource, which can be a controller action method, rather than to physical files on the web server.
- A typical page size is small, because no unnecessary data is transferred in the form of hidden ViewState data.
But most of our projects are highly data driven and needs to use asp server controls like GridView, datagrid etc. extensively, which would need to rewritten for MVC. But our project cost and estimates are based on reusable server controls so it would be difficult to re-write the things in the same efforts. For this I have shelved the idea of using MVC with ASP.NET in my new project, instead would still stay with WebForms.
But I am not at all undermining the importance of MVC and have actually become the fan of MVC framework in ASP.net eventually so in the meanwhile I would be updating myself and creating some of the basic controls in MVC so that it can be reused in our projects instead of writing it.
And who know Microsoft may add kindda server controls which are MVC based.
Here are some other referenced that may help choosing between WebForms and MVC
Thanks for reading this post!