Decoupling Ruby: Delegation vs Dependency Injection
20-Feb-2020 1726
We've all worked with tightly-coupled code. If a butterfly flaps its wings in China, the unit tests break. Maintaining a system like this is...unpleasant. In this article, Jonathan Miles dives into the origins of tight-coupling. He demonstrates how you can use dependency injection (DI) to decouple code. Then he introduces a novel decoupling technique based on delegation that can be useful when DI is not an option.
Decoupling Ruby: Delegation vs Dependency Injection #ruby #rubydeveloper #rubyonrails #Decoupling #Ruby: #Delegation #Dependency #Injection https://rubyonrails.ba/link/decoupling-ruby-delegation-vs-dependency-injection