What happened to UnityContainerExtension.Locator in Unity 2?

Oct 22, 2009 at 2:48 PM

Hi,

I was wondering what happened to UnityContainerExtension.Locator in Unity 2 (the drop from September). Most extensions (e.g. the MEF integration) make use of it. I could not figure out what I could use as a replacement in Unity 2

thanks

 

Eric

Oct 25, 2009 at 6:03 AM

The locator has been deleted for a couple of reasons. First, it was redundant - there wasn't anything you could do with the locator that you couldn't do with policies. That redundancy created lots of confusion about where to store stuff. Second, the easy accessibility of the locator ended up causing lots of problems due to inappropriate use of weak references. And finally, we've never actually needed it anywhere in the development of entlib or Unity, or in any other p&p asset. I took a brief poll earlier and nobody objected, so it was removed.

You can do the same thing with a policy object in the policy list, either a transient or persistent policy.