From: Tom Kos Date: 2013-03-07T06:45:32+09:00 Subject: Re: Coupling vs providing dependencies in Ruby Thanks, this is more or less how I'd do that. I'd maybe just add default arguments' values like: class SchedulerJob def initialize(schedule = RequestSchedule.new, pusher = RequestToQueuePusher.new) @schedule = schedule @pusher = pusher end ... end I'm far from stating that rubyists avoid SOLID principles, but it's hard to spot codebases with dependencies injected on regular basis. The only question remaining is that even using dependency injection you still need to "new" your dependencies somewhere. In Java you got things like Spring or Guice (frameworks for wiring up all stuff together). But I guess in ruby it may be easily done with default arguments doing "new" implicitly. Classes are still coupled but I think it may be bit better than "new" in methods. -- Posted via http://www.ruby-forum.com/.