9 ms·
DI is not about glorified globals at all. Nothing forces you to pass in the same object to all things dependend on it. It just allows you to pass in anything t
by _ikke_ 14y ago
DI is not about glorified globals at all. Nothing forces you to pass in the same object to all things dependend on it.
It just allows you to pass in anything the situation requires.
It allows your code to depend on an interface, instead of an implementation, even if the language doesn't have explicit interfaces.