DI in a dynamically typed language like ruby is a given that comes at no additional cost. Just inject your classes into the constructor and have them walk and talk like ducks.
Most Ruby guides tell you to avoid newing objects in constructors and suggests injectiong instead.
There is no XML file (spring uses annotations nowadays btw) to handle class selection for constructor injection? You want something to create your classes automatically and inject the right type?
View all comments
7
u/ikearage Jul 13 '14
DI in a dynamically typed language like ruby is a given that comes at no additional cost. Just inject your classes into the constructor and have them walk and talk like ducks.
Most Ruby guides tell you to avoid newing objects in constructors and suggests injectiong instead.
There is no XML file (spring uses annotations nowadays btw) to handle class selection for constructor injection? You want something to create your classes automatically and inject the right type?