Dependency Inversion Principle
Upcoming SlideShare
Loading in...5
×
 

Dependency Inversion Principle

on

  • 1,282 views

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

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

Statistics

Views

Total Views
1,282
Views on SlideShare
780
Embed Views
502

Actions

Likes
0
Downloads
12
Comments
0

8 Embeds 502

http://feeds.feedburner.com 253
http://tomphilip.me 166
http://localhost 65
http://tommysqueak.github.io 7
http://10.37.129.2 4
http://feedly.com 4
http://www.linkedin.com 2
http://translate.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Dependency Inversion Principle Dependency Inversion Principle Presentation Transcript

  • http://lifetuned.com http://pikpak.me Dependency Inversion@tommysqueak http://tomphilip.me
  • About• Dependency Injection• Service Location• TDD & Mocking - How they play together nicely• Auto-mocking• IOC - Tools, Features, Usage, Pros/Cons, Best Practice
  • 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.
  • 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 change my passwordThen It should ensure it is a strong passwordAnd it should change my passwordAnd it should notify me it has been changed
  • 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• Constructor Injection over Setter Injection over Service Location
  • 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