Dependency Injection

posted on 03/24/06 at 10:12:11 pm by Joel Ross

I've been looking at a few different design patterns, and one of the popular ones among TDD evangelists is Inversion of Control, or Dependency Injection. Both sound complicated. Or did, until I saw this from James Shore. Bottom line from James (literally and figuratively, in this case): "Dependency injection is really just passing in an instance variable."

He's able to break down exactly what it means, and give you a simple example. Then he goes on to show why it's an important concept for unit testing.

Of course, if you want the meaty details, go to the source: Martin Fowler has a very long and very detailed article about Inversion of Control that actually makes more sense once you read James' post.

Technorati Tags: | |

Categories: Development