This post originated from an RSS feed registered with Agile Buzz
by Joe Walnes.
Original Post: Inversion of Control and Dependency Injector Pattern
Feed Title: Joe's New Jelly
Feed URL: http://joe.truemesh.com/blog/index.rdf
Feed Description: The musings of a ThoughtWorker obsessed with Agile, XP, maintainability, Java, .NET, Ruby and OpenSource. Mmm'kay?
In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application. Underlying these containers is a common pattern to how they perform the wiring, a concept they refer under the very generic name of "Inversion of Control". In this article I dig into how this pattern works, give it the more specific name of "Dependency Injector", and contrast it with the Service Locator alternative. The choice between them is less important than the principle of separating configuration from use.