0
http://lifetuned.com                      http://pikpak.me               Dependency                 Inversion@tommysqueak ...
About•   Dependency Injection•   Service Location•   TDD & Mocking - How they play together nicely•   Auto-mocking•   IOC ...
Definition•   High-level modules should not depend    on low-level modules. Both should    depend on abstractions.•   Abst...
Design PatternsDependency Injection  Service Locator
StoryAs a CustomerI want to change my passwordIn order to keep my account secureScenarioGiven I’m an account holderWhen I ...
Demo
Benefits•   Loose coupling•   Re-use•   Testability
Inversion of Control
ProvideDependency Injection  Service Locator
Usage•   Registration•   Entry Point
Demo
Frameworks•AutoFac• NInject• Castle Windsor• StructureMap• Unity
How They Look
A Little Best Practice•   Internal code should not reference    the container directly•   Verify registration with tests• ...
Picture Credits•   http://www.flickr.com/        •   http://www.flickr.com/    photos/smil/4196304056/ -         photos/gc...
Dependency Inversion Principle
Upcoming SlideShare
Loading in...5
×

Dependency Inversion Principle

1,157

Published on

Covering DI, the D of SOLID. IOC tools, TDD and a bit of best practice

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,157
On Slideshare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
15
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Transcript of "Dependency Inversion Principle"

  1. 1. http://lifetuned.com http://pikpak.me Dependency Inversion@tommysqueak http://tomphilip.me
  2. 2. About• Dependency Injection• Service Location• TDD & Mocking - How they play together nicely• Auto-mocking• IOC - Tools, Features, Usage, Pros/Cons, Best Practice
  3. 3. Definition• High-level modules should not depend on low-level modules. Both should depend on abstractions.• Abstractions should not depend upon details. Details should depend upon abstractions.
  4. 4. Design PatternsDependency Injection Service Locator
  5. 5. StoryAs a CustomerI want to change my passwordIn order to keep my account secureScenarioGiven I’m an account holderWhen I change my passwordThen It should ensure it is a strong passwordAnd it should change my passwordAnd it should notify me it has been changed
  6. 6. Demo
  7. 7. Benefits• Loose coupling• Re-use• Testability
  8. 8. Inversion of Control
  9. 9. ProvideDependency Injection Service Locator
  10. 10. Usage• Registration• Entry Point
  11. 11. Demo
  12. 12. Frameworks•AutoFac• NInject• Castle Windsor• StructureMap• Unity
  13. 13. How They Look
  14. 14. A Little Best Practice• Internal code should not reference the container directly• Verify registration with tests• Constructor Injection over Setter Injection over Service Location
  15. 15. Picture Credits• http://www.flickr.com/ • http://www.flickr.com/ photos/smil/4196304056/ - photos/gcwest/ Patterns 281385801/ - containers• http://lostechies.com/ derickbailey/2009/02/11/ solid-development- principles-in-motivational- pictures/ - SOLID pictures• http://www.flickr.com/ photos/kevindean/ 4031083510/ - trolley
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×