Skip to main content

MVC or Web Forms




I.         I think both technologies can get a bit complicated after getting past any of the basics. Here are some brief opinions that I gathered while having to implement a project that must live in both MVC and WebForms hosts.
WebForms Positives:
  1. The maturity of the product
  2. Lots of 3rd party support with regard to sophisticated controls
  3. There are ways to get around the legacy-feeling aspects of the framework (e.g., WebForms MVP)
WebForms Negatives:
  1. Page lifecycle issues can anger you to no end; there are a lot of moving parts to a sophisticated web application
  2. Using dependency injection is "difficult" to use/implement
  3. There is a lot in the framework that you can't control
  4. Need something like Reflector to dive into decompiled source when have questions that are not answered by documentation, web, experimentation.
MVC Positives:
  1. Great separation of concerns and support of dependency injection
  2. More control over so many things (i.e., project structure, mvc framework, rendered content, etc)
  3. You can xcopy deploy your app along with the mvc framework on top of an asp.net 4 installation (i.e., to a 3rd party hosting provider)
  4. Native support of JSON
  5. Source code (w/ comments!!) provided so that you can dive into various features when you run into questions on the internals.
  6. They've been doing out-of-band releases on tooling and I believe plan to do so on the framework (?); they have a futures project along with the source that shows you some of the directions they are going and which you could make use of if you should choose to.
MVC Negatives:
  1. Can take a little time to wrap one's mind around
  2. Not as many 3rd party helpers (no controls); those that exist seem to be not as sophisticated as their WebForm counterparts
Personally, I'm an MVC fan because of the control, flexibility, and transparent dependency injection support. Perhaps you should do a small pilot with both technologies to see which one you prefer. Good luck and have fun!


II. If you care about extensibility, ease of maintenance, scalability and robustness of your application, as well as development of your software development skills, then stay as far away as possible from web forms.
The whole idea of adding a layer of state by wrapping everything in a form is just wrong. HTTP is stateless, and MVC is built around that model, which is good.
Edit In regards to the comments made. Web forms applications are not extensible because presentation layer, business logic and data access code (data sources) all reside in code behind. Controls that are offered by web forms are applicable only in web forms. This means that you won't be able to transfer these skills to another web development framework.
Finally, of course it is possible to write a tightly coupled application using MVC - there is always a way to destroy something. There is no argument about that. The main point is that MVC encourages a seperation of concerns and single responsibility principle, when web forms practically takes it away from you.
You have also said that web forms is easier. It's easier if you have been using it and it's faster to pick up in comparison to MVC, however, in a long-term run MVC is likely to become "easier". Watch few videos on www.asp.net/mvc. Additionally you might want to look into test-driven development (unit-testing). I don't think that unit testing works with web forms because everything is so tightly coupled. Please correct me if i'm wrong.
I would be very interested to hear opinions of other developers who have experience of working with both frameworks.

References:

1. www.stackoverflow.com

Comments

Popular posts from this blog

N-Tier Architecture Design Using MVC, Entity Framework and WCF

 

Evolution of .NET Frame work

          Microsoft .Net technology has a rapid development and great success over the years. This is one of the best development platforms and accepted by all levels of peoples. The features like interoperability, security, portability, simplicity and maintainability makes the .NET technology as great. The .Net framework created on the year 2002 and still the features added and various versions of framework released for advanced software development. What is .Net Framework?           The .NET Framework is an integral Windows component that supports building and running the next generation of applications and XML Web services. The .NET Framework is designed to fulfill the following objectives: To provide a consistent object-oriented programming environment whether object code is stored and executed locally, executed locally but Internet-distributed, or executed remotely. To provide a code-execution environment that minimizes software deployment and versioning conflicts. To