Service Locator Pattern,即服务定位模式,用于定位不同的服务.考虑到 InitialContext::lookup 的成本比较高,提供了 Cache 类缓存以定位到的服务. 代码实现 Service 接口 public interface Service { public String getName(); public void execute(); } Service1, Service2 实现 Service 接口,提供具体服务 public class Servic…
https://www.geeksforgeeks.org/service-locator-pattern/ Service Locator Pattern Last Updated: 06-03-2018 The service locator pattern is a design pattern used in software development to encapsulate the processes involved in obtaining a service with a s…
原文地址:http://www.tutorialspoint.com/design_pattern/service_locator_pattern.htm The service locator design pattern is used when we want to locate various services using JNDI lookup. Considering high cost of looking up JNDI for a service, Service Locato…