Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does Microsoft.Practices.ServiceLocation come from?

Does any one know where Microsoft.Practices.ServiceLocation comes from? This is a namespace and a dll used in MS EnterpriseLibrary. Admittedly it's a very simple dll with just a handful of classes (using reflector), but I can't find published source code for it. It's not in Enterprise Library project and not in Unity project.

So does someone know if the source code for this was published and where? And also why is it not part of Unity? Is it used anywhere else?

like image 521
Andrew Savinykh Avatar asked Oct 21 '10 21:10

Andrew Savinykh


2 Answers

It comes from: https://github.com/unitycontainer/commonservicelocator

From the project description:

The Common Service Locator library contains a shared interface for service location which application and framework developers can reference. The library provides an abstraction over IoC containers and service locators. Using the library allows an application to indirectly access the capabilities without relying on hard references. The hope is that using this library, third-party applications and frameworks can begin to leverage IoC/Service Location without tying themselves down to a specific implementation.

This abstraction is implemented by several IoC frameworks out there, and Unity is one of them. nevertheless, Unity is not the owner of that project.

This way StructureMap, for example, provides implementation of those clases, so other frameworks (such as Prism from patterns & practices) can easily work with other IoC frameworks and not be bound to Unity itself.

like image 180
Julian Dominguez Avatar answered Oct 25 '22 23:10

Julian Dominguez


If you want you can grab the NuGet package here:

http://www.nuget.org/packages/CommonServiceLocator/

like image 14
Leniel Maccaferri Avatar answered Oct 26 '22 01:10

Leniel Maccaferri