I have to admit that I wasn't that interested at first. I've done MVC in Struts. I've seen MVC in action in Ruby on Rails. There is already MonoRail in .NET that allows me to do MVC. So a MVC framework in .NET didn't really represent anything new to me. I figured Microsoft's version would be so convoluted that it would be more pain than pleasure.
I have to give credit to Scott Guthrie and his team. They definitely did their research into other MVC frameworks both .NET and in other languages.
- Unit testing
- Provides hooks for extensibility
- Convention over configuration
The framework is highly extensible. Everything conforms to an Interface. It comes with base implementations of the interfaces, but this allows teams to use their own implementation. That means teams will be able to use their prefered IoC container to create controllers. Or use monorail as the view engine if you'd like. Scott even showed an implementation of an attribute-based interface that cached responses from a controller. Open, Interface-based frameworks is something I was used to in the Java world, but hasn't always been the norm in the .NET world without putting stuff into the GAC or jumping through hoops.
Routing pretty much looks like you would do it in Ruby on Rails.
As a result, building RESTful applications in the .NET MVC framework is pretty simple. I did ask one question about Routing during the presentation. Did I have to go through the pains of configuring the mapping of every single controller? This was something that really annoyed me in Struts - large configuration files with every single Action class mapping. Microsoft definitely went the way of Ruby on Rails's routes.rb.
I was pleased to get the answer I wanted to hear. The framework's base routing mechanism (again, you can plug your own in) takes convention over configuration. If you have the following:
The routing service will look for a UserController class, and use the Index method by default. All that is needed is to tell the framework which namespace/dll the controller classes are in. The idea of convention over configuration is a powerful one. One which has lead many to Ruby of Rails, and will definitely be a plus for those adopting the Microsoft MVC framework.
I can't wait to get a CTP or Beta release of the MVC framework. Goodbye code-behind!