DEV Community

Discussion on: Explain dependency injection like I'm five

Collapse
 
greglockwood profile image
Greg Lockwood

Sometimes, the mechanics have really special needs and don't trust their boss to supply them with the best tool, so they bring their own instead. But this makes life harder for the owner, because if he wants to start servicing forklifts in addition to cars, he can't supply you with a new, all-in-one tool.

For DI to work, you have to trust that the best option for any given scenario can and will be supplied to you.