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
 
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
 
King Tut Architecture
King Tut ArchitectureKing Tut Architecture
King Tut ArchitectureGary Pedretti
 

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
 
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
 
King Tut Architecture
King Tut ArchitectureKing Tut Architecture
King Tut Architecture
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
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
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
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...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 

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