background preloader

Design Pattern

Facebook Twitter

Quince / Home. Design pattern – Inversion of control and Dependency injection. Updates added MVC and MVP design pattern tutorial date 19 december 2008 Table of Contents Updated Added link for how to do DI using Unity application bocks.

Design pattern – Inversion of control and Dependency injection

Introduction I have been writing and recording on design patterns for past some days. Inversion of Control Containers and the Dependency Injection pattern. In the Java community there's been a rush of lightweight containers that help to assemble components from different projects into a cohesive application.

Inversion of Control Containers and the Dependency Injection pattern

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, under the more specific name of "Dependency Injection", and contrast it with the Service Locator alternative. The choice between them is less important than the principle of separating configuration from use. One of the entertaining things about the enterprise Java world is the huge amount of activity in building alternatives to the mainstream J2EE technologies, much of it happening in open source.