Design Patterns: The Dependency Injection Matrix
I still remember the moment the lights went on. I rewrote the PaymentProcessor to accept a gateway via its constructor, wrote a fake gateway that just returned a success promise, and watched my tests pass in seconds. It felt like…