Why Unity?

Mar 25, 2008 at 3:12 PM
Hi there!

A co-worker of mine mentioned this project, and I'm interested in it because I'm in the middle of rolling my own lightweight IoC with a Service Locator. Getting permission to use open source software can be difficult for us, but we're allowed to use the Enterprise Library - so Unity's moving there means we might be able to use it.

Even the ability to download and view the source is a difficult process to walk through, so please let me ask here: what is the motivation for re-rolling another IoC when something like http://www.springframework.net has been around (and used and tested) for a long time? Does your IoC extend the ISite/IComponent/IServiceProvider/IContainer interfaces that the .NET library already provides in System and System.ComponentModel? Finally, when do you suppose an architecture overview document might be available? If one is available already, please forgive me; but I didn't find one.

If Unity meets the needs of our project I'd love to be able to drop mine and use it.
Mar 25, 2008 at 9:11 PM
I think you've already answered your question:

Getting permission to use open source software can be difficult for us

We (p&p and Microsoft) have many customers that either are leery of, or flat out won't touch open source software. We at p&p think that IoC is a very important pattern and want to push it more. However, we cannot be seen as endorsing any particular open source project over another, since there's no clear "standard" IoC container out there. And even if we did, those customers who are leery of open source will be unable to take advantage of the guidance.

Having our own IoC container is also helping our internal discussions; having a wholly MS owned implementation really helps push the concept inside MS as well.

Having said that, I (in my biased opinion) think Unity is shaping up to be a pretty good container. Evaluate what's out there according to what meets your needs and go with it. We aren't trying to get people to stop using Spring, Windsor, et. al; if they work for you go for it!

So that's the justification part. As for your other questions:

No, we don't extend anything from System.ComponentModel. It probably wouldn't take much to implement IServiceProvider, for example. Not on our 1.0 roadmap though.

The current CHM has an architectural overview in it. If you have specific questions about how Unity works please feel free to ask me.