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:- The maturity of the product
- Lots of 3rd party support with regard to sophisticated controls
- There are ways to get around the legacy-feeling aspects of the framework (e.g., WebForms MVP)
- Page lifecycle issues can anger you to no end; there are a lot of moving parts to a sophisticated web application
- Using dependency injection is "difficult" to use/implement
- There is a lot in the framework that you can't control
- Need something like Reflector to dive into decompiled source when have questions that are not answered by documentation, web, experimentation.
- Great separation of concerns and support of dependency injection
- More control over so many things (i.e., project structure, mvc framework, rendered content, etc)
- 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)
- Native support of JSON
- Source code (w/ comments!!) provided so that you can dive into various features when you run into questions on the internals.
- 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.
- Can take a little time to wrap one's mind around
- Not as many 3rd party helpers (no controls); those that exist seem to be not as sophisticated as their WebForm counterparts
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
Post a Comment