Re:Ask HN: Concepts that clicked only years after you first ...
by sanderjd on Sunday January 01, 2023 @11:43AM
(#34207852)
The first example is also dependency injection. The rest of what you described is why a dependency injection framework often becomes useful in a system with a large dependency tree.
The alternative to dependency injection is for functions to instantiate dependencies internally rather than having them be passed in from the calling context.
The alternative to dependency injection is for functions to instantiate dependencies internally rather than having them be passed in from the calling context.