Where does Microsoft.Practices.ServiceLocation come from?

柔情痞子 提交于 2019-12-02 16:27:55
Julian Dominguez

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.

If you want you can grab the NuGet package here:

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

Its a part of Enterprise Library : http://msdn.microsoft.com/en-us/library/ff664629(PandP.50).aspx.

Download it, together with documentation, from http://entlib.codeplex.com/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!