gpt4 book ai didi

.net - Microsoft.Practices.ServiceLocation 从哪里来?

转载 作者:行者123 更新时间:2023-12-03 05:22:05 32 4
gpt4 key购买 nike

有人知道 Microsoft.Practices.ServiceLocation 来自哪里吗?这是 MS EnterpriseLibrary 中使用的命名空间和 dll。诚然,这是一个非常简单的 dll,只有少数类(使用反射器),但我找不到它的已发布源代码。它不在 Enterprise Library 项目中,也不在 Unity 项目中。

那么有人知道这个源代码是否已发布以及在哪里发布?为什么它不是 Unity 的一部分?还用在其他地方吗?

最佳答案

来自:https://github.com/unitycontainer/commonservicelocator

来自项目描述:

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.

这种抽象由多个 IoC 框架实现,Unity 就是其中之一。尽管如此,Unity 并不是该项目的所有者。

这边走StructureMap例如,提供了这些类的实现,因此其他框架(例如来自模式和实践的Prism)可以轻松地与其他IoC框架一起使用,而不必绑定(bind)到Unity。本身。

关于.net - Microsoft.Practices.ServiceLocation 从哪里来?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3992072/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com