Why you should use dependency injection
Briefly

In software development, hard-coding specific implementations without considering future needs can lead to inflexible systems. This is exemplified through the development of an e-commerce application using a specific payment processor. Hard-coding the payment processing class leads to significant problems if the processor changes or additional payment methods are required. Instead, utilizing abstractions like interfaces can allow developers to create flexible and easily testable systems that can adapt to business changes.
What you should have done instead is realize that you are going to need an abstraction... and write all your code against it and not a specific implementation.
Read at InfoWorld
[
|
]