5
© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE Dependency Injection July 12, 2013

Deep Dive into Dependency injection

Embed Size (px)

Citation preview

Page 1: Deep Dive into Dependency injection

© TalentSoft – Deep Dives – Dependency Injection – Julien PLEE

Dependency Injection

July 12, 2013

Page 2: Deep Dive into Dependency injection

© 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.

Page 3: Deep Dive into Dependency injection

© 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…

Page 4: Deep Dive into Dependency injection

© 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.

Page 5: Deep Dive into Dependency injection

© 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