Microsoft Patterns & Practices released Enterprise Library 4.1. Enterprise Library 4.1 is primarily a bug release. However, there are numerous changes and additions to the Unity Application Block v1.2 which ships with Enterprise Library 4.1.
Here are the big changes I see in Unity v1.2:
- Generic Decorator Chains are fixed!
- Support was added for generic parameter injection configuration with the GenericParameter support in the InjectedMembers API. A new configuration element enables you to do the same configuration through a configuration file.
- A PerThreadLifetimeManager was added. The container returns the same instance on the same thread and a different instance on different threads.
- Support for injecting arrays was added! The implementation for the ResolvedArrayParameter support was added; it relies on the ResolveAll method in IUnityContainer. Both the core mechanism and the API support are implemented. Configuration support for ResolvedArray is provided with the <array> configuration element.
- Interception added!
- InterceptionExtension.PolicyDefinition APIs were added to provide a simplified way to wire together RuleDrivenPolicies to support interception. The general purpose API requires repeated calls to the InjectedMembers.ConfigureInjectionFor and RegisterType methods. The streamlined extension API reduces the overhead required to manage the various strings and cross links, thus making the process more obvious and convenient.
- Unity interception support was added, including configuration support. You can now define interceptors and when they should be used. Interceptors are defined like lifetime managers: you can just specify a type and you will get an instance of that type. You can also specify a value and, optionally, a type converter to provide more information about how the interceptor should be built.
I still have a number of tutorials to get through on Unity, but here are some examples of the Interception Mechanism:
See Enterprise Library Tutorials and Unity Tutorials for more information as well as Patterns & Practices Screencasts.
Download Enterprise Library 4.1 here.