Slide 26
Slide 26 text
Recap
• Dependency Injection is simply passing in object dependencies
as parameters instead of instantiating them in the object using them
• Doing this gives you Inversion of Control, as the control over
object creation is no longer delegated to the object using them
• Using interfaces, we can adhere to the Dependency Inversion
Principle and depend on abstractions
• Code always starts off procedural, and builds objects up before
executing them in an object oriented manner
• If you use don’t do this, other people will hate you because they can’t
mock your objects easily in their tests (so your code is not testable)
@J7mbo