The Easy Life<br />Inversion of Control with StructureMap<br />
What is a dependency?<br />
Any thingthe code I’m working on needs to work that is not the code I’m working on<br />
Our Problem SpaceTIME TO USE YOUR IMAGINATION<br />
SprocketStore<br />Photo Credit<br />
Get the current market price for a sprocket<br />Call the Sprocket Market web service <br />Check for a quantity discount<...
Dependency Inversion Principle<br />“High-level modules should not depend on low-level modules.  Both should depend on abs...
“High-level modules should not depend on low-level modules.  Both should depend on abstractions.”<br />
Are dependencies bad?<br />
Photo Credit<br />
Rigidity<br />Photo Credit<br />
Fragility<br />Fragility<br />Photo Credit<br />
Immobility<br />Photo Credit<br />
Dependency Inversion Principle<br />“High-level modules should not depend on low-level modules.  Both should depend on abs...
SprocketStore<br />SprocketStore<br />ISalesDatabase<br />SalesDatabase<br />SalesDatabase<br />
Easier<br />Maintenance<br />Photo Credit<br />
Testability<br />Photo Credit<br />
Here we go!<br />
Dependency Injection<br />Photo Credit<br />
Upcoming SlideShare
Loading in …5
×

Inversion of Control with StructureMap

1,392 views

Published on

Simplify your life with Inversion of Control! One of the most challenging aspects of software development is dealing with code that depends on other code. The Dependency Inversion principle tells us that we should depend on abstractions, not concretions but it doesn’t tell us how to do that. That’s where Dependency Injection comes in – we inject our dependencies into the mushy center of our classes with a big syringe. This can often be as messy as it sounds, but luckily Inversion of Control Containers can help us by providing a single source for configuring dependencies. This presentation will show how to effectively manage dependencies with StructureMap, an open-source IOC container. StructureMap can make your life easier, your code more maintainable, and the world a better place.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,392
On SlideShare
0
From Embeds
0
Number of Embeds
8
Actions
Shares
0
Downloads
32
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Inversion of Control with StructureMap

  1. 1. The Easy Life<br />Inversion of Control with StructureMap<br />
  2. 2. What is a dependency?<br />
  3. 3. Any thingthe code I’m working on needs to work that is not the code I’m working on<br />
  4. 4. Our Problem SpaceTIME TO USE YOUR IMAGINATION<br />
  5. 5. SprocketStore<br />Photo Credit<br />
  6. 6.
  7. 7. Get the current market price for a sprocket<br />Call the Sprocket Market web service <br />Check for a quantity discount<br />Look it up in the sales database<br />Return the final price<br />Multiply the discount price by the quantity requested<br />
  8. 8.
  9. 9. Dependency Inversion Principle<br />“High-level modules should not depend on low-level modules. Both should depend on abstractions.”<br />
  10. 10. “High-level modules should not depend on low-level modules. Both should depend on abstractions.”<br />
  11. 11. Are dependencies bad?<br />
  12. 12. Photo Credit<br />
  13. 13. Rigidity<br />Photo Credit<br />
  14. 14. Fragility<br />Fragility<br />Photo Credit<br />
  15. 15. Immobility<br />Photo Credit<br />
  16. 16. Dependency Inversion Principle<br />“High-level modules should not depend on low-level modules. Both should depend on abstractions.”<br />
  17. 17. SprocketStore<br />SprocketStore<br />ISalesDatabase<br />SalesDatabase<br />SalesDatabase<br />
  18. 18. Easier<br />Maintenance<br />Photo Credit<br />
  19. 19. Testability<br />Photo Credit<br />
  20. 20. Here we go!<br />
  21. 21. Dependency Injection<br />Photo Credit<br />

×