ASP.NET MVC Framework? Don’t Mind If I Do

October 20, 2007


I’m spending the weekend at work (don’t ask), so I had some time to read some articles and view some webcasts I left behind. I finally got to watching the entire lecture Scott Guthrie gave at the ALT.NET conference about the ASP.NET framework. You can check out the video here, and read about in Scott’s blog, here.

My initial impression of this was: Wow. This is so awesome. Finally ASP.NET is becoming a testable, maintainable platform. As I’ve mentioned, my team has recently entered TDD. The only thing that is incredibly hard to test in our architecture are the WebForms pages. There are ways to overcome this, but none of them is natural because of one simple truth: WebForms has tight coupling between logic (.cs file) and view (.aspx file). Furthermore, the suggested way to test ASP.NET pages in VSTS requires using a web-server, and loading the entire ASP.NET, well, stuff. And that is all kinds of slow.

Using the MVC framework we will have testable controllers (which are just classes with some logic in them, which you can test like any other class), and views that are really responsible only for display. Also, everything will have an interface. Dear IHttpContext, how I’ve longed for you since the dawn of time.

It definitely seems like this will be the way to develop applications over ASP.NET (although standard WebForms will continue to be supported and developed, says Guthrie). My main concern is the transition between the two platforms. For the project, and for the team. For the project, we currently have the standard ASP.NET web site (which sucks. We now wish we had chosen Web Application Project. We sure do miss that .csproj file), and a whole bunch of .aspx files. System.Web.MVC will work in an entirely different way: Controllers will have several views, no post-back, no view-state. Moving will probably be incredibly hard.

For the team this will also be difficult. We are so accustomed to working with the control life-cycle model, using and writing server-controls that handle their state, that this will probably take us a long way back in terms of productivity, initially. In fact, none of us developed web applications in anything other than ASP.NET, so the "step back" that the MVC framework takes towards working more closely with HTML might be problematic.

But problems aside, I really can’t wait to get my hands on this framework and start playing with it. It feels very right, and seems to me like a step in the right direction by Microsoft.

Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>



  1. PashaOctober 21, 2007 ב 14:59

    If you want MVC so badly, you can use Monorail in the meanwhile.

  2. Doron YaacobyOctober 21, 2007 ב 17:14

    I thought about it, and even gave Monorail a shot. I found that the learning curve was way too stiff, and the lack of decent support for .aspx (you can use it as a view-engine, but it is not recommended) and server controls would make the transition a nightmare.

    I’m hoping that the ASP.NET MVC, since it’s coming from Microsoft, will address these issues. Also, it will be much easier to sell on the chiefs. “This is the officially recommended way to develop applications in ASP.NET, boss. Microsoft says so”.

  3. OhadOctober 26, 2007 ב 19:45

    I found Castle’s monorail a bit problematic, instead of using WebControl like repeater or GridView, you should use spaghetti code?

    Lately I found the NMVP project in CodePlex, it looks like a great project, and I’m trying using it: