DEV Community

Discussion on: Ruby devs, how do you work?

Collapse
 
hiddewie profile image
Hidde Wieringa

Thank you for your comment.

I meant "DI is not really a thing" as in "in Ruby, DI is often not needed in the form of an entire framework as the backbone of your application".

Solargraph seems interesting, I will definitely look into that for code analysis!

Collapse
 
tadman profile image
Scott Tadman

Ruby doesn't lean too heavily on the dependency injection pattern, but it's still something you can see occur in many forms.

In other languages with a more formal implementation of this where it occurs is much more obvious, but in Ruby there's a very smooth gradient between light applications of this, like mixin methods from modules, to entire frameworks built around it, like Rails, and everything in-between.

So basically dependency injection is rarely forced on you, but it's there if you need it, and you can do it however you want.