Decoupling Ruby: Delegation vs Dependency Injection

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 https://rubyonrails.ba/single/decoupling-ruby-delegation-vs-dependency-injection

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles