Dependency Injection

Dependency Injection

Dependency Injection is a design pattern with the result of decoupling dependent application processes with hard coded implementations. We talk about it a lot with the ability to change from using one implementation of something with another. For example, substituting one database engine with another one, or even different versions or vendors of storage technologies.

Instead of coding the dependency the different layers of code are share a common interface. The implementation of the interface is injected into the application at compile or run time. This has a lot of benefits allowing for greater software flexibility, reduced impact when implementing change, and enhanced ability to test. There are many other benefits as well.

Yesterday I came across this white paper from Microsoft about their Unity Dependency Injection tool that is gaining acceptance. You can find more information on Unity at . I found the paper useful for first introducing the reason for Dependency Injection, and then providing instructions for using the Unity framework. I find the read very straight forward and helpful for explaining a sophisticated development pattern in conjunction with other patterns such as MVC.

I’m curious how it may be gaining ground in comparison to open systems tools such as NInject, etc. Are you using Unity? Perhaps you are reading this white paper yourself in an effort to enhance your skills with Dependency Injection.
How are you finding it to help or not help you? Share your thoughts online or by email to btaylor@sswug.org.