Before Unity (i): From the ObjectBuilder, introduced the unity of the bottom frame objcetbuilder. At the same time, I said a little: they (patterns & practices) Once again made the old habit of stalling (to be fair, this problem is one of the Enterprise Library team most prominent). Unexpectedly, today see Unity's Masters Grigori said: Unity Release the date is moved to April 7. Also have to wait:)
Really do not want to introduce the current unstable version, mainly to see the version of March 12 than one months ago the CTP has a lot of changes, afraid! Do not want to wait for the official version, the current introduction of the code to compile the N-many errors-if not completely change the words. Here is an article about the changes between these two versions: IoC Container, Unity and breaking Changes galore. huh! Before Terrylee also had an article on the introduction: The Unity Application Block (1): Quick Start, is for the February CTP, well, yes, his sample code used in the API is now changed ...
However, at this time to do some general introduction or appropriate, after all, the big direction has not changed. Well, at least that's what I thought ...
What is Unity?
Unity is a lightweight, scalable, dependency injection container developed by the patterns & practices team with the following characteristics:
1. It provides a mechanism for creating (or assembling) object instances that may also contain other dependent object instances.
2. Unity allows a pre-configured object to be injected into the class, enabling the inversion of control (IoC) functionality. In unity, support is constructor injection (constructor injection), property setter Injection (attribute set value injection), and method call injection (methods injection). PS: The method injection here is similar to the interface injection defined by Martin Fowler and slightly different.
3. Support the architecture of the container. A container can have child containers that allow you to locate queries from child containers to the parent container's object.
4. You can prepare and configure the container through a configuration file.
5. It does not affect the definition of the class (except for attribute set value injection and method injection), which is also a manifestation of lightweight containers.
6. Support for custom container extensions.