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.
5. Why Use StructureMap?
âą Achieve loose coupling
âą Extensibility everywhere
Design âą Improve testability
âą SOLID!
âą Mature: one of the oldest containers
âą One of the fastest IoC containers
Features âą Easy to learn Domain Specific Language
âą Fully-loaded
9. Service Locator
Design pattern which encapsulates the
processes 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.
10. 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 the
defines the data displays the data. model, tells the
to be displayed. view what to do.
11. 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));
12. ASP.NET MVC DependencyResolver
Hey, give me the
HomeController!
ASP.NET MVC
Pipeline SmDependencyResolver
Here ya go!
Container.GetInstance(
typeof(HomeController));
13. 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 instance
contract for the type
Base type that of the service
being extended. implements in interface to add
the interface. new behavior.
17. To Recap
IoC 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!
18. Want to know more?
http://trycatchFAIL.com @matthoneycutt
Blog, Videos, and I might say something
More! interesting some dayâŠ