Scott Hanselman

DevConnections - The ASP.NET MVC Framework

November 08, 2007 Comment on this post [19] Posted in ASP.NET | ASP.NET MVC | Programming | Speaking
Sponsored By

imageThe work on the ASP.NET MVC Framework continues.

Phil's been playing with RhinoMocks writing tests for his MVC Samples, and Chris Tavares has his samples using Castle Windsor running as his Inversion of Control Container.

Eilon Lipton, the primary developer on the MVC project, and I presented at DevConnections yesterday. In fact, he and I did three presentations together in one day, which may have been a mistake. ;)

Anyway, I think Eilon and I worked pretty well as a team on stage. We wanted to get the point across. What's the point? This is not Web Forms 4.0.

I used the example of a Car vs. a Motorcycle. Both are two ways to get from Point A to Point B with their own advantages and drawbacks. The inclusion of this framework within System.Web is about offering alternatives. It will be a fully supported, fundamental part of the System.Web and isn't going anywhere.

It's also very extensible. We showed demos with Castle Windsor, RhinoMocks, as well as crazier samples like the DLR under MVC and running XML-RPC over MVC to try out an idea that Phil and I could get Windows Live Writer talking to MVC ala REST.

One important point I kept stressing in the talk was that this is designed to be compatible with the ASP.NET subsystems you already use. That means Session, Cache, Personalization, Roles, Membership, etc, still work and are there to be used and abused. This framework, in the namespace System.Web.Mvc, is an alternate architecture, but not "an entirely new parallel ASP.NET," no more than any of the other home-grown or open source MVC/MVP frameworks that are out there.

Here's a link to Eilon and my slides from DevConnections. If you don't have Office 2007, grab the Compatibility Pack for Office XP, 2000 or 2003 and you'll be able to open them. I'll record a screencast of the talk perhaps next week. There should be some public bits to play with in December sometime.

I'm going to give a very similar presentation at the PNP Summit today at 8:30am. ScottGu has had to cancel his keynote at the PNP Summit, so my MVC Framework talk will replace that. I'll also be presenting on Friday at 8:30am (the "ending" keynote) on "Community: my first 8 weeks inside the Big Blue Monster" so more on that talk soon.

Also, as a reminder, don't forget to come by the Nerd Dinner tonight at 6:30pm! Here's some links to help you remember and add this to your calendar:

Enjoy!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
November 08, 2007 15:05
The MVC framework looks very interesting - when will we be able to get our hands on it? :)
November 08, 2007 15:09
Big thanx for this presentation but I really miss the domos :(
November 08, 2007 15:13
Want!
November 08, 2007 15:43
You bet! :-)
Can you upload to rapidshare.com?
November 08, 2007 17:23
"Ruby View Engine & Python Controller - It's a kindler, gentler Microsoft. No Seriously. Hug?"

Nice...
November 08, 2007 18:07
Great presentation. Can you post the source code from the demo? I'll understand if it's missing the MVC dependancy.
November 08, 2007 18:20
As a former J2EE developer who used the Struts-Tiles framework for extending the MVC Model2 architecture, I am excited to implement this framework. When I first transitioned to ASP.NET not too long ago, the current architecture (what's the pattern it represents anyway?) was one of the pain points. I really look forward to reviewing your slides and getting my head around this.

Thanks, again, to you and Eilon's work on this presentation as well as to the rest of the ASP.NET team's continued drive to refine!

- Nate

November 08, 2007 19:06
It would be nice to have screencast of this presentation.... and/or some code...
When is expected to be released in CTP?
November 08, 2007 21:28
Hey Now Scott,
The line: SOAP is for Dorks just sticks in my brain. I thought that was funny.
Hanselminutes Fan,
Catto
November 08, 2007 21:40
Nice presentation, let us know when MVC is available!

November 08, 2007 22:15
Car vs. motorcycle? More like station wagon (webforms) vs. convertible (MVC). I know what I'd choose!
November 08, 2007 23:34
I'm doing my very best to get bits. Lemme ask The Gu if we can give away the apps without the refrences. That's a good idea.
November 09, 2007 1:49
This may not be the best place for it, but I've been meaning to weigh in on this, so lucky you, Scott, here are my rambling thoughts:

Having come from the Java world and also written a couple of Rails apps and having played with Monorail, I've had a lot experience with MVC and I'd say it's usually neither a motorcycle nor a convertible. It's a bicycle. It's nowhere near as sophisticated as WebForms. Granted, many web apps are simple ones, but it's worth noting that MVC frameworks generally don't offer the richness of the component-based ones. Still, most of them aren't as buggy as the component-based ones, either). I could write an MVC framework over a weekend. I don't think I would ever try to write a WebForms, and that's both a complement and an insult to WebForms.

Funny that the MS world is moving in the opposite direction as the java world, which after producing many MVC frameworks has spent the past few years moving towards a component-tree approach comparable to WebForms. Java ServerFaces is still controversial, but it's also nowhere near as solid as WebForms. In many ways WebForms is very very impressive. Unfortunately it sucks at a lot of stuff too.

It seems to me that most MVC's strengths are in binding, pipelines, routing, dependency injection, open source-dness, and testability. Coincidentally, WebForms sucks at all these things. MVC is a good, simple alternative. Definitely more accessible to new developers, lowering the barrier to entry. But personally, I would really rather see WebForms fixed to improve the things I just mentioned (start by looking at JSF - it did get a few things right, like dependency injection and command objects). WebControls and ViewState are very useful concepts, but many of the WebControls themselves are just poorly designed (trying a little too hard, and failing, to be simple for Mort) and nearly impossible for an outside assembly to fix. DropDownList, for example, is horrible, but it could be improved.

It also seems to me that the MVC approach to making an app "testable" (specifically, testable outside the web container), means that you essentially write off the View part as untestable, which means you make the View as dumb as possible and write a LOT of code that, for any rich UI, may end up being very UI-centric. Call me a dreamer, but I'd rather have a View / UI layer that is both rich and testable.

I don't get why it needs to be either/or.
November 09, 2007 3:55
"Lemme ask The Gu if we can give away the apps without the refrences."

W000000t, I'd love to see the demo code, though an actual CTP/Beta would be that little bit awesomer (is that a word?). Also, does your new nickname for ScottGu mean you're "The Ha"?

(Mega Hanselminutes Fan)
November 09, 2007 14:00
@Winston:

I believe that rich web interfaces will be constructed on the client. Just make sure you have a unordered list in your HTML and use something like Ext to create a tree out of it. No need for the ASP.NET TreeView, in fact, using Ext you can do so much more in the tree, like drag and drop.
November 09, 2007 15:10
-- Winston Fassett
> (MVC is) accessible to new developers, lowering the barrier to entry.
> (The praise of web forms interspersed throughout the post)

Two major reasons why web forms have failed are:
- The people who conceived and perpetrated web forms had had no experience of web development.
- The people who conceived and perpetrated web forms had been hell-bent on making web development easy and simple for the masses of VB6 programmers and future enthusiastic newcomers.

The only comfort I find in the news about the MVC Framework is that, this time around, Microsoft seems to have engaged experienced people, e.g. Phil Haack.

I fear Microsoft is aiming to release a polished or semi-polished product that may not turn out to be great, but it will so late in the production cycle that Microsoft will be reluctant to reverse gears.

Microsoft has made the source code of AspNet visible. It shouldn't be afraid of making the MVC Framework's code and development process visible so that we may comment early.

Why not have daily or weekly builds?
November 10, 2007 6:43
I loved the presentation. I thought you and Eilon played very well off of each other, and definitely left wanting a part 2 of MVC instead of Part 3 of ASP.NET. :D
November 14, 2007 21:28
@Mike - I see your point. But my choice of the word "rich" may have been confusing. I meant that component-frameworks can produce a richer server-side product. For example, component frameworks can have, um, components. UserControls, for example, are very useful, and any MVC analog would pale in comparison, usually just amounting to "includes" in the view. While many MVCs have configurable "pipelines" and dependency injection, I have never seen one that allowed you to assemble larger components out of smaller ones (and that's still useful even if you are composing your UI out of JS components). With MVC, you are basically giving that up, IMO.

I do agree that MVC / REST is currently better suited to stuff like Ext TreeViews, but I believe that it's partly because WebForms has always had an uneasy relationship with state, coupled with a fairly inflexible lifecycle. I'm optimistic that it could be done, but I do agree with (what I believe to be) your comments on Is Microsoft Committe to AJAX? that no one is doing it.

@texasBelle -

- "perpetrated"? Seriously? Like WebForms was some horrible crime?
- I cannot believe that the people behind WebForms had "no experience of web development". That's a ridiculous assertion.
- I do agree with your second point, but I think that has begun to change. Everyone needs to accept that component-oriented web frameworks are complicated and will require not only a solid understanding of the web idiom, but often also an understanding of the inner-workings of the framework and controls themselves. Most of the documentation I've seen glosses over how things actually work, with only occasional scattered blog posts illuminating dark corners, so I've had to use reflector a LOT in order to understand what's going on.

This is where I agree that open-sourcedness and transparency is key, even for Microsoft.

November 15, 2007 22:26
Thanks for publishing.

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.