News for hackers. Stuff that matters.
Re:Dependency Injection is dangerous for your career by hammerdr on Thursday February 10, 2011 @02:52AM (#2201199)
> I'll make the connection object a parameter rather than have the method set up the connection itself

Parameter (Dependency) Injection.

> I might make the connection object a parameter to the constructor

Constructor (Dependency) Injection.

> construct it in a helper method that I can override for testing purposes.

Not DI.

http://martinfowler.com/articles/injection.html

Edit:

For languages such as Java and C#, wiring up these objects is quite a pain.

For duck typed languages such as Python and Ruby, it isn't that big of a pain. So we just do it. Just because you don't have an IoC framework doesn't mean you aren't practicing DI :)

Re:Dependency Injection is dangerous for your career by rimantas on Thursday February 10, 2011 @03:33AM (#2201272)