StructureMapping               Your Way to      Better Software        Matt Honeycutt        @matthoneycutt     http://try...
The Plan  Better    StructureMap   StructureMap   Advancedsoftware?       Basics        in Action    Recipes
SOLID PrinciplesSingle ResponsibilityOpen-ClosedLiskov SubstitutionInterface SegregationDependency Inversion
SOLID
Why Use StructureMap?           • Achieve loose coupling           • Extensibility everywhereDesign     • Improve testabil...
Code!
Everyone Loves WebForms!
Service Locator Design pattern which encapsulates theprocesses involved in obtaining a service.      Requester            ...
Model-View-Presenter MVP is a user interface design pattern engineered to   improve the separation of concerns within an  ...
ASP.NET MVC DependencyResolver                http://mysite/Home/Index                   Hey, give me the                 ...
ASP.NET MVC DependencyResolver                Hey, give me the                HomeController!  ASP.NET MVC    Pipeline    ...
Decorator Pattern  Design pattern that allows behavior to    be added to an object at runtime.  Service Interface     Deco...
Decorator Pattern     SomeOtherDecorator     : IProductRepository   ProductLoggingDecorator     : IProductRepository  InMe...
Think compositionally!“Favor composition over inheritance!”
We’ve only just begun!
To RecapIoC rocks. Use it. Embrace it!There’s a learning curve… but it’s worth it!Makes it easier to create SOLID code.Do ...
Want to know more?http://trycatchFAIL.com     @matthoneycutt   Blog, Videos, and      I might say something         More! ...
Structure mapping your way to better software
Upcoming SlideShare
Loading in …5
×

Structure mapping your way to better software

451 views

Published on

Slides corresponding to my devLink 2012 talk on StructureMap. Get the code at https://github.com/MattHoneycutt/Presentations, and find more info at http://trycatchfail.com.

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
451
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
9
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • * To code!
  • * Code
  • * Back to code!
  • Back to code!
  • Structure mapping your way to better software

    1. 1. StructureMapping Your Way to Better Software Matt Honeycutt @matthoneycutt http://trycatchfail.com
    2. 2. The Plan Better StructureMap StructureMap Advancedsoftware? Basics in Action Recipes
    3. 3. SOLID PrinciplesSingle ResponsibilityOpen-ClosedLiskov SubstitutionInterface SegregationDependency Inversion
    4. 4. SOLID
    5. 5. Why Use StructureMap? • Achieve loose coupling • Extensibility everywhereDesign • Improve testability • SOLID! • Mature: one of the oldest containers • One of the fastest IoC containersFeatures • Easy to learn Domain Specific Language • Fully-loaded
    6. 6. Code!
    7. 7. Everyone Loves WebForms!
    8. 8. Service Locator Design pattern which encapsulates theprocesses involved in obtaining a service. Requester Service Locator Based on configuration, builds Asks the locator for a up and returns the requested particular service. service.
    9. 9. Model-View-Presenter MVP is a user interface design pattern engineered to improve the separation of concerns within an application’s presentation layer. Model View Presenter Object that Interface that Acts upon thedefines the data displays the data. model, tells theto be displayed. view what to do.
    10. 10. ASP.NET MVC DependencyResolver http://mysite/Home/Index Hey, give me the HomeController! ASP.NET MVC Pipeline DependencyResolver Here ya go! Activator.CreateInstance( typeof(HomeController));
    11. 11. ASP.NET MVC DependencyResolver Hey, give me the HomeController! ASP.NET MVC Pipeline SmDependencyResolver Here ya go! Container.GetInstance( typeof(HomeController));
    12. 12. Decorator Pattern Design pattern that allows behavior to be added to an object at runtime. Service Interface Decorated Type Decorator Defines the public Wraps an instancecontract for the type Base type that of the service being extended. implements in interface to add the interface. new behavior.
    13. 13. Decorator Pattern SomeOtherDecorator : IProductRepository ProductLoggingDecorator : IProductRepository InMemoryProductRepository : IProductRepository
    14. 14. Think compositionally!“Favor composition over inheritance!”
    15. 15. We’ve only just begun!
    16. 16. To RecapIoC rocks. Use it. Embrace it!There’s a learning curve… but it’s worth it!Makes it easier to create SOLID code.Do it all with StructureMap!
    17. 17. Want to know more?http://trycatchFAIL.com @matthoneycutt Blog, Videos, and I might say something More! interesting some day…

    ×