设计模式中最简单和容易理解的就是单例(单件)模式(SingleTon),单例服务(Singleton Service)也是一种单件模式的实践应用的例子。单例服务(Singleton Service)就是针对所有客户端而言,都只有一个服务实例。
基于70个网页-相关网页
A singleton service locator with a resource cache creates a global cache that cannot properly handle the component-level mappings for an overloaded resource name.
带有资源缓存的集合服务定位器创建全局缓存,通过这种方式不能为重载的资源名正确处理组件级映射。
The remaining alternative is to use a service locator, make it a singleton, but remove the reference cache.
剩下的一个选择是使用服务定位器使用集合的方式,但是要去除引用缓存。
We have seen that an overloaded resource name and the typical service locator implementation, a singleton with a resource cache, do not get along.
我们已经看到了重载资源名和典型服务定位器实现,有资源缓存的集合,但他们之间并没有很好的合作。
应用推荐