"If you know you will never change the implementation or configuration of some dependency, there is no benefit in using dependency injection.".
It all boils down to this.
Here's the catch, though: with dependencies, it is really, really hard to know you will never change the implementations. In most languages, implementing dependency injection is so trivial that it is always worth it. The work associated with changing implementations that aren't built with some form of loose coupling is in most cases, non-trivial.
It all boils down to this.
Here's the catch, though: with dependencies, it is really, really hard to know you will never change the implementations. In most languages, implementing dependency injection is so trivial that it is always worth it. The work associated with changing implementations that aren't built with some form of loose coupling is in most cases, non-trivial.