MVC Experiments

December 11th, 2007

As I promised here, you can download the samples I created on my visit to MS. What’s in there?

MvcExtensions: a class library project with all extensions developed including parameter binder support, Windsor integration and a NVelocity View Engine. I remember complaining about relying exclusively on inheritance to change behavior/add specializations. Looks like I’m not alone on this… To some things, a vertical approach is good enough, but not usually to frameworks. The inheritance scheme eventually will turn into hell in a complex project. I know as I been there.

RestSupport: Uri formats and a nice Respond To syntax inspired on the work from Chris Ortman/MonoRail.RestSupport.

UsingAR: self explanatory

UsingNVelocity: ditto.

Looks like they still need to make some things virtual and some things public. If you read my code you’ll eventually bump into interesting comments :-)

Categories: General | Top Of Page | 16 Comments » |

16 Responses to “MVC Experiments”

Tom Opgenorth Says:

Just downloading these to take a peek. But, I am curious: have you considered including these the the mvccontrib project:

josh Says:

Thanks, Hammett. Now if I could just download some extra time in my day to try this and other MS MVC stuff out.

MVC.NET « .net and other musings Says:

[...] Take a look at his blog post for more details and to download the samples here. [...]

hammett Says:

@Tom, I think Jeffrey will. I have no idea how to operate with Codeplex…

Haacked Says:

I bet if you gave your permission to Jeffrey Palermo, he’d add it for you. ;)

hammett Says:

@Phil, he contacted me yesterday, I gave the permission.

Chris Ortman Says:

@hammett: Thanks for the nod.

>> “Looks like they still need to make some things virtual and some things public”

This is exactly my biggest complaint against this framework. Sure during this early phase we can tell them that we need something virtual and they might do it. But 1 year down the road when that Internal class makes extending impossible or a real PITA then what? Wait for the next release of visual studio?

hammett Says:

@Chris, my argument to them was: give power to the people. I think their audience is much more wider then an OSS project, so they are concerned about not giving a monkey a gun as the monkey might shot someone.. but I think they could be pleasantly surprised if they just assume people will get it and use it right (most of times, at least) :-)

Rhywun Says:

> But 1 year down the road when that Internal
> class makes extending impossible or a real PITA
> then what?

Switch to Ruby? *ducks*

hammett Says:

Dont need to duck. If the switch makes sense for your company/client/app/scenario, go for it.

Chris Ortman Says:

@Rhywun: it will be an interesting day when/if that should ever become Redmond’s response to that issue.

Tuna Toksoz Says:

Hey Hamilton, thanks for the project. Will be really helpful for me.

One bug that I saw is
IContainerAccessor accessor = (IContainerAccessor) context.HttpContext.ApplicationInstance;

if (accessor == null)
throw new ApplicationException(“Whoops, looks like you forgot to make your Global app ” +
“class implement the IContainerAccessor interface”);

the problematic line is
IContainerAccessor accessor = (IContainerAccessor) context.HttpContext.ApplicationInstance;

I believe it should be

IContainerAccessor accessor = context.HttpContext.ApplicationInstance as IContainerAccessor;

since “as” makes it null if the conversation fails.


hammett Says:

That makes sense! I guess the cold weather of Redmond affected my brain ;-)

lame excuse, I know.

Talbott Crowell Says:

In his most recent blog post MVC Experiments, hammet includes the samples for download that he created on his visit to Microsoft.

bahareh tahery Says:

hi .i want to know about castle project , nmonorail and mvc . i can’t find a good and compelet article about these . please help me

MvcContrib now offers four (4) alternative view engines for ASP.NET MVC - Jeffrey Palermo [MVP] Says:

[...] Adapted by Hammet and added to MvcContrib with [...]

Leave a Reply