Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Infrastructure code that matters
Model                  ActionRouting                Binding                Result          Controller             Validati...
   Restful routing - http://bit.ly/GAl1IG   To build nested collections:     http://localhost/blogs/{id}     http://lo...
   IoC container - three calls pattern   Your MVC application MUST NOT have    Resolve calls inside it   AutoFac http:/...
   Use FluentValidation - http://bit.ly/GBp3QZ   No attributes   Easy extended   MVC client/server side integration  ...
   http://automapper.codeplex.com/   Do not show domain entities to user   Map ViewModels to domain   Once again conve...
   All posted here http://bit.ly/GBafxA   Conventional Mapping   LifeTime is managed by IoC container   Transactions a...
Action                         ActionRouting                    Filter                         Filter• Restful            ...
   Mvc Scaffolding   Mvc Contrib     Grid     Strongly typed Html helpers     Strongly typed redirects     Test help...
Upcoming SlideShare
Loading in …5
×

Mvc extension points in action

6,611 views

Published on

Presentation shows how asp.net mvc extension points can be used to build all infrastructure for business applicaions

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Mvc extension points in action

  1. 1. Infrastructure code that matters
  2. 2. Model ActionRouting Binding Result Controller Validation Render Factory Result 2
  3. 3.  Restful routing - http://bit.ly/GAl1IG To build nested collections:  http://localhost/blogs/{id}  http://localhost/blogs/{blogId}/Posts/  http://localhost/blogs/{blogId}/Posts/{id}  http://localhost/blogs/{blogId}/Posts/{postId}/Comments To be RESTful  For DELETE and PUT special hidden field is used to support usual form submittion Convetion over configuration 3
  4. 4.  IoC container - three calls pattern Your MVC application MUST NOT have Resolve calls inside it AutoFac http://bit.ly/GBH1Au  No matter why or what kind of IoC container you use  Prefer to have convention based registration  Keep in mind CommonServiceLocator project http://bit.ly/GB9lB5 4
  5. 5.  Use FluentValidation - http://bit.ly/GBp3QZ No attributes Easy extended MVC client/server side integration Easy globalization support Unit testing friendly 5
  6. 6.  http://automapper.codeplex.com/ Do not show domain entities to user Map ViewModels to domain Once again convention over configuration Unit test friendly 6
  7. 7.  All posted here http://bit.ly/GBafxA Conventional Mapping LifeTime is managed by IoC container Transactions are handled by ActionFilters Always have integration test to validate mappings 7
  8. 8. Action ActionRouting Filter Filter• Restful • Begin • End routing transaction transaction Controller Validation Factory • Fluent • Dependency Validation Resolver • Autofac 8
  9. 9.  Mvc Scaffolding Mvc Contrib  Grid  Strongly typed Html helpers  Strongly typed redirects  Test helpers Automoq to simulate your IoC container ModelBinders, ValueProviders for custom form data 9

×