Deep Dive into Dependency injection

Preview:

Citation preview

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Dependency Injection

July 12, 2013

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Usefulness of Dependency Injection

“It is very hard to make existing systems more maintainable. It is much better to design for maintainability from the very start.”• Therefore, Maintainability is one of our design

goals

• Testability: TDD forces the design to be testable, reduce likelihood of regressions, and make refactoring easier. + Test Doubles.

• Flexibility and extensibility: always remember business requirements often change.

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Usefulness of Dependency Injection

• Late Binding is the ability to replace part of our system without recompiling (e.g.: plug-in architecture)

• Parallel Development: Managing multiple groups to ensure independently developed component will work together

• Crosscutting concerns: Validation, Exception Handling, Logging…

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Usefulness of Dependency Injection

“Loose coupling should be a general design goal for your enterprise applications.”• Loose Coupling, as opposed to Tight Coupling,

means reducing the number of dependencies between components of your system.

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Software Development Principles

• SOLIDo Single Responsibility Principleo Open Closed Principleo Liskov Substitution Principleo Interface Segregation Principleo Dependency Injection Principle

Recommended