To MVC or not to MVC

There's no doubt in my mind that thinking about MVC and/or MVP frameworks is bound to scare some developers out there. Changing the entire approach to ASP.NET development by throwing out ViewState and Postbacks is bound to make some people ask "Why fix it if it aint broke?"

A lot of the MVC related writing at the moment seems to focus on the benefits of using the MVC approach - Yay for TDD! Yay for clean URLs! Yay for extensible pluggable architectures! Yay foreach Benefit benefit in List<MVC_Benefit> benefits!

Which is all fine and dandy, however I liked some of the snippets in this article on code magazine, which approach things from the other direction.

What's wrong with web forms?

Many developers agree that the Postback and ViewState model employed by Web Forms causes pain and heartache. A quick Google search for “ViewState problem” and “Postback problem” brings back 300,000+ and 400,000+ results, respectively.

As much as you might love developing with ASP.NET (and I do!), it's very likely you've spent some time messing about with Viewstate and Postback issues. I guess the question has to be if you weren't using those 2 pieces of technology, would you just find something else to cause you problems, or would your life simply be grand? Well, now you've got a chance to find out! Isn't life fantastic?

My favorite quote from the article is this one

The main problem with Web Forms is that it employs an elaborate scheme to hide the developer from the stateless nature of HTTP

It sums it up nicely. I've spent a lot of time trying to explain to clients what the phrase "stateless client" means, to the point where recently I've just given up. "It's magic!" seems to be a lot more effective, and it makes them smile! A smiling client is a good client.

When you read the above quote, and realise that most of what's being done with ASP.NET webforms involves making the web work in ways which it was never really intended to, then the MVC framework makes even more sense. Go on, embrace it, you know you want to.

Link: Use the ASP.NET MVC Framework to Write Web Apps without Viewstate or Postbacks

Tags: ,
Posted on Tuesday, November 13, 2007 10:04 PM |

Like this? Share it!

No comments posted yet.

Post a comment
Please add 4 and 2 and type the answer here:
Remember me?
Ensure the word in this box says 'orange':