Common Service Locator library
来源:互联网 发布:软件验收结算清单 编辑:程序博客网 时间:2024/05/06 21:38
你在你的应用程序应用IoC容器了吗,你是否希望不依赖于某个具体的IoC,微软的模式与实践团队在Codeplex上发布的Common Service Locator。Common Service Locator 类库包含应用程序和框架开发者引用Service location共享的接口。这个类库提供了在IOC容器和Service locators之上抽象。使用这个类库允许一个应用程序在没有强引用依赖下间接的访问的能力。它所定义的接口非常简单:
namespace Microsoft.Practices.ServiceLocation
{
public interface IServiceLocator : IServiceProvider
{
object GetInstance(Type serviceType);
object GetInstance(Type serviceType, string key);
IEnumerable<object> GetAllInstances(Type serviceType);
TService GetInstance<TService>();
TService GetInstance<TService>(string key);
IEnumerable<TService> GetAllInstances<TService>();
}
}
namespace Microsoft.Practices.ServiceLocation
{
public static class ServiceLocator
{
private static ServiceLocatorProvider currentProvider;
public static IServiceLocator Current
{
get { return currentProvider(); }
}
public static void SetLocatorProvider(ServiceLocatorProvider newProvider)
{
currentProvider = newProvider;
}
}
}
Common Service Locator官方: http://www.codeplex.com/CommonServiceLocator
- Common Service Locator library
- Common Service Locator library
- Common Service Locator
- Common Service Locator的Unity适配器
- Service Locator Pattern
- Service Locator Design Pattern
- Service Locator Patten 总结
- Service Locator服务定位器
- 服务定位器模式(service locator)
- [Design Pattern] Service Locator Pattern
- IoC,Dependency Injection,Service Locator
- Core J2EE Patterns - Service Locator
- Dependency Injection 和 Service Locator
- Service Locator 模式 的学习
- (服务定位器)Service Locator
- 用SERVICE LOCATOR 模式实现命名访问
- 用SERVICE LOCATOR 模式实现命名访问
- Java Service Locator Pattern(服务器定位模式)
- 免费的Entity Framework电子书
- 理解SynchronizationContext
- 黑客常用dos命令
- WebForms使用System.Web.Routing
- DeepEarth:使用Silverlight的地图控件
- Common Service Locator library
- Windows 远程管理WinRM
- Tomcat4.1、5.5、6.0的连接池配置及测试程序
- WiX安装选项---开始菜单项
- Silverlight 2 DataGrid December 2008
- WiX安装选项--注册程序集到GAC和VS的设计时环境
- WiX安装选项--环境变量
- TCP/IP 选项TcpTimedWaitDelay设置
- SQL Server 2005最新Service Pack 3