re: Explain dependency injection like I'm five VIEW POST

TOP OF THREAD FULL DISCUSSION
re: I just spent over an hour trying to create an example. Decided it's the wrong approach even if it's not the #explainlikeimfive version. The hardest...
 

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.

code of conduct - report abuse