Dependency Injection Is a Virtue

Marcel Weiher rebuts David Heinemeier Hansson: Having hard-coded class-names like in the example Time.now is effectively the same as communicating via global variables. DHH’s suggestion of stubbing out the Time class’s now is selling us mutable global variables as the solution to global variables. Or more precisely: passing an argument to a method by modifying … Continue reading Dependency Injection Is a Virtue