SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
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

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante a 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
 
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
 

Semelhante a 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
 

Último

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
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
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
 
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
 
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
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

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
 
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
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
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
 
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 ...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
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
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
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
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

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