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 #rails #rubyonrails #bosnia #programming #tutorials #rubydeveloper #railsdeveloper