The Unity Application Block (Unity) is a lightweight, extensible dependency injection container with support for constructor, property, and method call injection. You can use it with Enterprise Library to generate both Enterprise Library objects and your own custom business objects. However, the Unity Application Block differs from the other application blocks included in Enterprise Library in several fundamental ways:
- You can use the Unity Application Block as a stand-alone dependency injection mechanism without requiring installation of Enterprise Library.
- The Unity Application Block can use configuration information exposed through configuration files to prepare the container, but you can also use code to register dependencies dynamically at run time.
- The Unity Application Block has no dependency on the Enterprise Library core or the Enterprise Library configuration system. It contains its own built-in mechanism for reading configuration—although, if appropriate, this information can come from the normal Enterprise Library configuration file.
This section of the documentation describes the Unity Application Block and demonstrates how you can use it in your applications to generate instances of custom objects. It contains the following sections: