The ASP.NET MVC Definition

26 Jul

image A few days ago I posted a question to the community, looking for a definition of the ASP.NET MVC framework that didn’t depend upon faults in ASP.NET WebForms – after all, faults can be fixed.  I also do not like the implication that ASP.NET MVC is for those looking to use the MVC pattern, as I’ve been using that pattern for a decade and I use it in WebForms today.  Credit goes to Lucas Goodwin for helping me with the following definition:

ASP.NET MVC is the evolution of Classic ASP.

I’ve helped a number of developers move from Classic ASP to ASP.NET, and each one has said to me, "wow, this is nothing like ASP" once they groked it.  This is true, and mostly because WebForms introduced an event based paradigm to ASP.  Classic ASP had problems, but was the lack of events one of them?

Classic ASP’s number one problem was lack of separation of concerns.  This is the same reason I don’t like PHP, my code is far to friendly with my HTML (gotta keep em’ separated).  True you can discipline yourself to provide a separation, but it’s not something the framework designers gave much thought to.

WebForms fixed the separation issue, but at the same time brought in the event model.  I liked this "magic controller" approach, because it saves me the time I used to spend wiring up controllers that just ended up back at the same template I started with.  (For the record, I was mostly working with python before moving to WebForms, first with a framework called Albatross and later SnakeSkin)  An event model is not required to have separation of concerns, and this forced an event model on to many Classic ASP developers.  So I will add a bit to the definition:

ASP.NET MVC is the evolution of Classic ASP, adding an easier separation of concerns while not using an event based model like WebForms.

So do you agree or disagree?  I like this definition because it’s not claiming either approach is better, and I can look to the pros and cons of an event based model to guide me in selecting MVC or WebForms for a project.  It also is less likely to cause rioting in the streets at your next user group meeting when the topic comes up!

  • I would say that ASP.NET MVC is a simplication of WebForms rather than an evolution of Classion ASP. WebForms is a complete overhaul of Classic ASP (at times too much the other way). MVC is a nice compromise between the two worlds. It gives you the control you want over your application as well as the great benefits that the ASP.NET platform has to offer.

  • Evolution might be a poor choice of words; more the spiritual successor to Classic ASP that WebForms was not. I don’t agree with the control aspect, as it implies I have given up control over my application with WebForms, when that’s not the case – the end result (what the user sees) can be identical between both.