SlideShare ist ein Scribd-Unternehmen logo
1 von 16
Downloaden Sie, um offline zu lesen
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 Patterns
Dependency Injection

  Service Locator
Story
As a Customer
I want to change my password
In order to keep my account secure
Scenario
Given I’m an account holder
When I change my password
Then It should ensure it is a strong password
And it should change my password
And it should notify me it has been changed
Demo
Benefits
•   Loose coupling
•   Re-use
•   Testability
Inversion of Control
Provide
Dependency 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

Weitere ähnliche Inhalte

Andere mochten auch

Business Model Generation: Business Model Canvas + Design Thinking
Business Model Generation: Business Model Canvas + Design ThinkingBusiness Model Generation: Business Model Canvas + Design Thinking
Business Model Generation: Business Model Canvas + Design ThinkingSiddhant Choudhary
 
Overview of Business Model Canvas Tools
Overview of Business Model Canvas ToolsOverview of Business Model Canvas Tools
Overview of Business Model Canvas ToolsChristoph Plamper
 
Innovation & Business Model & Business Model Canvas 2014
Innovation & Business Model & Business Model Canvas 2014Innovation & Business Model & Business Model Canvas 2014
Innovation & Business Model & Business Model Canvas 2014Serdar Temiz
 
20150216 design thinking dans l'Ă©ducation
20150216 design thinking dans l'Ă©ducation20150216 design thinking dans l'Ă©ducation
20150216 design thinking dans l'Ă©ducationSerge Van Oudenhove
 
Business Model Canvas (Dr. Htet Zan Linn)
Business Model Canvas (Dr. Htet Zan Linn)Business Model Canvas (Dr. Htet Zan Linn)
Business Model Canvas (Dr. Htet Zan Linn)Htet Zan Linn
 
Overview of business model canvas tools
Overview of business model canvas toolsOverview of business model canvas tools
Overview of business model canvas toolsChristoph Plamper
 
Business Model Canvas Poster Deutsch V 1.1
Business Model Canvas Poster Deutsch V 1.1Business Model Canvas Poster Deutsch V 1.1
Business Model Canvas Poster Deutsch V 1.1Thorsten Faltings
 
Leading and Managing Change [Change Management]
Leading and Managing Change [Change Management]Leading and Managing Change [Change Management]
Leading and Managing Change [Change Management]Siddhant Choudhary
 
(Pre) Accelerate towards the future!
(Pre) Accelerate towards the future!(Pre) Accelerate towards the future!
(Pre) Accelerate towards the future!Startup Pirates
 
Design Thinking and the Business Model Canvas for the Mobile Economy
Design Thinking and the Business Model Canvas for the Mobile EconomyDesign Thinking and the Business Model Canvas for the Mobile Economy
Design Thinking and the Business Model Canvas for the Mobile EconomySerge Van Oudenhove
 
Business model Canvas
Business model CanvasBusiness model Canvas
Business model CanvasIbrahim Faza
 
How To Design A Good A P I And Why It Matters G O O G L E
How To Design A Good  A P I And Why It Matters    G O O G L EHow To Design A Good  A P I And Why It Matters    G O O G L E
How To Design A Good A P I And Why It Matters G O O G L Eguestbe92f4
 
OOP Principles
OOP PrinciplesOOP Principles
OOP PrinciplesDahyun Kim
 
Business Model Canvas
Business Model CanvasBusiness Model Canvas
Business Model CanvasTom Philip
 
Business Model Canvas
Business Model CanvasBusiness Model Canvas
Business Model Canvassvanebjerg
 
Business Model Websites Canvas Poster- format Checkliste
Business Model Websites Canvas Poster- format ChecklisteBusiness Model Websites Canvas Poster- format Checkliste
Business Model Websites Canvas Poster- format ChecklisteThorsten Faltings
 

Andere mochten auch (16)

Business Model Generation: Business Model Canvas + Design Thinking
Business Model Generation: Business Model Canvas + Design ThinkingBusiness Model Generation: Business Model Canvas + Design Thinking
Business Model Generation: Business Model Canvas + Design Thinking
 
Overview of Business Model Canvas Tools
Overview of Business Model Canvas ToolsOverview of Business Model Canvas Tools
Overview of Business Model Canvas Tools
 
Innovation & Business Model & Business Model Canvas 2014
Innovation & Business Model & Business Model Canvas 2014Innovation & Business Model & Business Model Canvas 2014
Innovation & Business Model & Business Model Canvas 2014
 
20150216 design thinking dans l'Ă©ducation
20150216 design thinking dans l'Ă©ducation20150216 design thinking dans l'Ă©ducation
20150216 design thinking dans l'Ă©ducation
 
Business Model Canvas (Dr. Htet Zan Linn)
Business Model Canvas (Dr. Htet Zan Linn)Business Model Canvas (Dr. Htet Zan Linn)
Business Model Canvas (Dr. Htet Zan Linn)
 
Overview of business model canvas tools
Overview of business model canvas toolsOverview of business model canvas tools
Overview of business model canvas tools
 
Business Model Canvas Poster Deutsch V 1.1
Business Model Canvas Poster Deutsch V 1.1Business Model Canvas Poster Deutsch V 1.1
Business Model Canvas Poster Deutsch V 1.1
 
Leading and Managing Change [Change Management]
Leading and Managing Change [Change Management]Leading and Managing Change [Change Management]
Leading and Managing Change [Change Management]
 
(Pre) Accelerate towards the future!
(Pre) Accelerate towards the future!(Pre) Accelerate towards the future!
(Pre) Accelerate towards the future!
 
Design Thinking and the Business Model Canvas for the Mobile Economy
Design Thinking and the Business Model Canvas for the Mobile EconomyDesign Thinking and the Business Model Canvas for the Mobile Economy
Design Thinking and the Business Model Canvas for the Mobile Economy
 
Business model Canvas
Business model CanvasBusiness model Canvas
Business model Canvas
 
How To Design A Good A P I And Why It Matters G O O G L E
How To Design A Good  A P I And Why It Matters    G O O G L EHow To Design A Good  A P I And Why It Matters    G O O G L E
How To Design A Good A P I And Why It Matters G O O G L E
 
OOP Principles
OOP PrinciplesOOP Principles
OOP Principles
 
Business Model Canvas
Business Model CanvasBusiness Model Canvas
Business Model Canvas
 
Business Model Canvas
Business Model CanvasBusiness Model Canvas
Business Model Canvas
 
Business Model Websites Canvas Poster- format Checkliste
Business Model Websites Canvas Poster- format ChecklisteBusiness Model Websites Canvas Poster- format Checkliste
Business Model Websites Canvas Poster- format Checkliste
 

Ă„hnlich wie Dependency Inversion Principle

Integration Reloaded - Integration solutions based on reactive principles
Integration Reloaded - Integration solutions based on reactive principlesIntegration Reloaded - Integration solutions based on reactive principles
Integration Reloaded - Integration solutions based on reactive principlesSven Bernhardt
 
20181025 integration reloaded_integration_solutions_based_on_reactive_principles
20181025 integration reloaded_integration_solutions_based_on_reactive_principles20181025 integration reloaded_integration_solutions_based_on_reactive_principles
20181025 integration reloaded_integration_solutions_based_on_reactive_principlesOPITZ CONSULTING Deutschland
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarLohith Goudagere Nagaraj
 
Governance and Security Solution Patterns
Governance and Security Solution Patterns Governance and Security Solution Patterns
Governance and Security Solution Patterns WSO2
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionLearnNowOnline
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018Taswar Bhatti
 
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPhil Leggetter
 
Augmented Reality based Product Identification and Advertising System - Final...
Augmented Reality based Product Identification and Advertising System - Final...Augmented Reality based Product Identification and Advertising System - Final...
Augmented Reality based Product Identification and Advertising System - Final...Udara Alwis
 
Architectural Considerations for Startups
Architectural Considerations for StartupsArchitectural Considerations for Startups
Architectural Considerations for StartupsNiall Roche
 
Trunk-Based Development and Toggling
Trunk-Based Development and TogglingTrunk-Based Development and Toggling
Trunk-Based Development and TogglingBryan Liu
 
The Dependency Injection - Sorin Damian, Software Developer@RomSoft
The Dependency Injection - Sorin Damian, Software Developer@RomSoftThe Dependency Injection - Sorin Damian, Software Developer@RomSoft
The Dependency Injection - Sorin Damian, Software Developer@RomSoftRomSoft SRL
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsTaswar Bhatti
 
RubyConf 2012: Custom Reverse Proxies
RubyConf 2012: Custom Reverse ProxiesRubyConf 2012: Custom Reverse Proxies
RubyConf 2012: Custom Reverse Proxiesnickblah
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsTimmy Kokke
 
Oracle licensing rules the 5 fatal mistakes
Oracle licensing rules   the 5 fatal mistakesOracle licensing rules   the 5 fatal mistakes
Oracle licensing rules the 5 fatal mistakesKay Williams
 
Opportunities for the Stock Photo and Microstock Industry
Opportunities for the Stock Photo and Microstock IndustryOpportunities for the Stock Photo and Microstock Industry
Opportunities for the Stock Photo and Microstock IndustryAmos Struck
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePointTim McCarthy
 
Integrating multiple CDNs at Etsy
Integrating multiple CDNs at EtsyIntegrating multiple CDNs at Etsy
Integrating multiple CDNs at EtsyLaurie Denness
 
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"Christopher Hamm
 
Ng Sydney Dynamic Templates Talk - 18 April 2018
Ng Sydney Dynamic Templates Talk - 18 April 2018Ng Sydney Dynamic Templates Talk - 18 April 2018
Ng Sydney Dynamic Templates Talk - 18 April 2018Roger Kermode
 

Ă„hnlich wie Dependency Inversion Principle (20)

Integration Reloaded - Integration solutions based on reactive principles
Integration Reloaded - Integration solutions based on reactive principlesIntegration Reloaded - Integration solutions based on reactive principles
Integration Reloaded - Integration solutions based on reactive principles
 
20181025 integration reloaded_integration_solutions_based_on_reactive_principles
20181025 integration reloaded_integration_solutions_based_on_reactive_principles20181025 integration reloaded_integration_solutions_based_on_reactive_principles
20181025 integration reloaded_integration_solutions_based_on_reactive_principles
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So Far
 
Governance and Security Solution Patterns
Governance and Security Solution Patterns Governance and Security Solution Patterns
Governance and Security Solution Patterns
 
SQL: Permissions and Data Protection
SQL: Permissions and Data ProtectionSQL: Permissions and Data Protection
SQL: Permissions and Data Protection
 
8 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 20188 cloud design patterns you ought to know - Update Conference 2018
8 cloud design patterns you ought to know - Update Conference 2018
 
Patterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 appsPatterns and practices for building enterprise-scale HTML5 apps
Patterns and practices for building enterprise-scale HTML5 apps
 
Augmented Reality based Product Identification and Advertising System - Final...
Augmented Reality based Product Identification and Advertising System - Final...Augmented Reality based Product Identification and Advertising System - Final...
Augmented Reality based Product Identification and Advertising System - Final...
 
Architectural Considerations for Startups
Architectural Considerations for StartupsArchitectural Considerations for Startups
Architectural Considerations for Startups
 
Trunk-Based Development and Toggling
Trunk-Based Development and TogglingTrunk-Based Development and Toggling
Trunk-Based Development and Toggling
 
The Dependency Injection - Sorin Damian, Software Developer@RomSoft
The Dependency Injection - Sorin Damian, Software Developer@RomSoftThe Dependency Injection - Sorin Damian, Software Developer@RomSoft
The Dependency Injection - Sorin Damian, Software Developer@RomSoft
 
Cloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong CodeaholicsCloud Design Patterns - Hong Kong Codeaholics
Cloud Design Patterns - Hong Kong Codeaholics
 
RubyConf 2012: Custom Reverse Proxies
RubyConf 2012: Custom Reverse ProxiesRubyConf 2012: Custom Reverse Proxies
RubyConf 2012: Custom Reverse Proxies
 
JavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform appsJavaScript in Universal Windows Platform apps
JavaScript in Universal Windows Platform apps
 
Oracle licensing rules the 5 fatal mistakes
Oracle licensing rules   the 5 fatal mistakesOracle licensing rules   the 5 fatal mistakes
Oracle licensing rules the 5 fatal mistakes
 
Opportunities for the Stock Photo and Microstock Industry
Opportunities for the Stock Photo and Microstock IndustryOpportunities for the Stock Photo and Microstock Industry
Opportunities for the Stock Photo and Microstock Industry
 
Writing Testable Code in SharePoint
Writing Testable Code in SharePointWriting Testable Code in SharePoint
Writing Testable Code in SharePoint
 
Integrating multiple CDNs at Etsy
Integrating multiple CDNs at EtsyIntegrating multiple CDNs at Etsy
Integrating multiple CDNs at Etsy
 
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"
Code Palousa presentation- "Giving Digital Eyes to your Synthetic Tests"
 
Ng Sydney Dynamic Templates Talk - 18 April 2018
Ng Sydney Dynamic Templates Talk - 18 April 2018Ng Sydney Dynamic Templates Talk - 18 April 2018
Ng Sydney Dynamic Templates Talk - 18 April 2018
 

KĂĽrzlich hochgeladen

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

KĂĽrzlich hochgeladen (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 âś“Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

Dependency Inversion Principle

  • 1. http://lifetuned.com http://pikpak.me Dependency Inversion @tommysqueak http://tomphilip.me
  • 2. About • Dependency Injection • Service Location • TDD & Mocking - How they play together nicely • Auto-mocking • IOC - Tools, Features, Usage, Pros/Cons, Best Practice
  • 3.
  • 4. 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.
  • 6. Story As a Customer I want to change my password In order to keep my account secure Scenario Given I’m an account holder When I change my password Then It should ensure it is a strong password And it should change my password And it should notify me it has been changed
  • 8. Benefits • Loose coupling • Re-use • Testability
  • 10. Provide Dependency Injection Service Locator
  • 11. Usage • Registration • Entry Point
  • 12. Demo
  • 13. Frameworks •AutoFac • NInject • Castle Windsor • StructureMap • Unity
  • 15. A Little Best Practice • Internal code should not reference the container directly • Verify registration with tests • Constructor Injection over Setter Injection over Service Location
  • 16. 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