Start with convention for controller location, etc. and then only use configuration to override conventions. Actually created Convention classes with lambda expressions to allow you to override the convention.
(This is where Weston's video died due to battery charging issues. Alper Sunar also has video. Will try to get a link when it is available.)
Behaviors
Fowler calls them commands in the Front Controller.
FubuMVC calls them behaviors using the Chain of Responsibility pattern. Originally, they were called decorators, but Steve Harman said decorators were too specific. He suggested the term behaviors.
Chad showed the Unit of Work pattern as an example of Behaviors
HttpHandlers allow before and after actions, but not full control. Behaviors give that control.
Cultural Differences
Safety vs. Sharp Tools
Why can't you abort a request in ASP.NET MVC?
Convention scanning vs. Configuration
All done at the same time in FubuMVC
In ASP.NET MVC, there are several places to do configuration
Never manage urls, etc. directly in FubuMVC. No magic strings. For example:
return resolver.UrlFor<HomeController>();
So, if you rename the HomeController, it just flows through.
"Why, now?" - question from Ben Scheirman
None of the following were available before:
Routing
C# Lambdas
Better Ioc container behavior
Why not use MonoRail?
Not as much functional composition
Embracing Inversion of Control (IoC)
Pervasive throughout FubuMVC
Everything is injected via IoC (Views, Controllers, ActionInvokers, etc.)
Login Status implemented as a behavior that runs after the Action
URL Defaults done through convention, but all can be overwritten with configuration.
One Model In One Model Out(OMIOMO) aka Thunderdome Principle
Controller action in ASP.NET MVC has two responsibilities: Action and Return Result
FubuMVC breaks up these into two different responsibilities.
Can use a different approach. Does not require OMIOMO.
Generic Dictionary Converter
Pulls from request to build the InputModel automatically using static reflection (may not be in the published code, yet).
See Jeremy Miller's MSDN Article for example of Convention over Configuration (need citation).
Want to keep Controller Actions very simple to make them easier to test.
The implementation of the Configuration code is Chad's least favorite thing in FubuMVC. Looking for ways to make it easier.
Comments (0)
You don't have permission to comment on this page.