Resolving policy enabled objects with Unity 2.0
June 14, 2010
I had the opportunity to use Unity and Enterprise Library in my current project. On of the really cool features of Enterprise Library (and most Dependency Injection frameworks) is the support for Aspect Oriented Programming. It’s a really neat way of handling the cross-cutting concerns in your application.
I was therefore very surprised when I had a really hard time to get, what I thought was simple, the following scenario to work:
I want the objects that I resolve to be “policy enabled” – i.e. configured in such a way that I can add policies in the configuration that can be picked up later and applied to the resolved objects.
That is, it was hard in Enterprise Library 4.1 and Unity 1.2. I had to scan the net and put together a solution of my own. It was a mix of extension...