1. An individual scheme does not have to be classified as being just one of "name" or "locator".
对于单独的方案,没有必要将其分为仅仅是一个 “名称”或者是一个“定位器”。

www.ibm.com

2. This is because the service locator will cache the resource for whichever component uses the overloaded name first.
这是因为服务定位器将缓存不论哪个组件首次使用时所重载的名称的资源。

www.ibm.com

3. The client passes in a unique identifier -- a resource name -- for the resource; the service locator finds the resource and returns it to the client.
客户端为资源传递一个唯一的标识符(资源名),服务定位器找到这个资源并把它返回给客户端。

www.ibm.com

4. To find a food bank near you, visit the organization’s Food Bank Locator.
如果你想找到离你较近的食物银行,请访问该组织的定位器。

article.yeeyan.org

5. When everything is managed by the DI container, the service locator can be thanked for its good work and deleted.
当所有一切都由DI容器管理之后,服务定位器就可以完成它的历史使命并被删除了。

www.infoq.com

6. If the service locator class is part of a utility JAR shared by multiple applications, those applications will share the same instance.
如果服务定位器类是JAR通用性的一部分并被多个应用程序共享,这些应用程序将共享相同的实例。

www.ibm.com

7. When two components use a resource name that is overloaded -- that is, a name that is bound to two different resources -- a caching service locator returns the same resource to both components.
当两个组件使用一个重载的资源名,也就是说,一个名称绑定到两个不同的资源,缓存服务定位器为两个组件返回相同的资源。

www.ibm.com

8. If they do not contain such annotated methods, they will further resolve the resource handling the request by delegating to the appropriate subresource locator.
如果它们不包含如此注释的方法,那么它们将会通过指派给合适的子资源定位器来进一步解析此资源处理请求。

www.ibm.com

9. Then DB2 opens the cursor returns from the procedure and processes the locator allocation to the result set.
然后,DB2打开从过程中返回的游标,并处理分配给结果集的定位器。

www.ibm.com

10. Just as predicted, overloaded resource names and a caching service locator makes the code execute differently; it makes some components get the wrong resources.
正如所预测的那样,重载的资源名和缓存服务定位器使得代码执行有不同的结果,它使某些组件取得错误的资源。

www.ibm.com

11. So overloaded resource names mess up a service locator and its cache.
重载资源名使得服务定位器与其缓存之间变得混乱。

www.ibm.com

12. But the service locator should not include a resource cache.
但是服务定位器不应包含资源缓存。

www.ibm.com

13. Do not just assume that a caching service locator significantly improves application performance; use performance testing to confirm that it does.
不要只假设缓存服务定位器能显著的提高应用程序的性能,要使用性能测试来证明这一点。

www.ibm.com

14. We have seen that an overloaded resource name and the typical service locator implementation, a singleton with a resource cache, do not get along.
我们已经看到了重载资源名和典型服务定位器实现,有资源缓存的集合,但他们之间并没有很好的合作。

www.ibm.com

15. When you have exhausted the list of Singletons to eliminate, you can revisit the code fragments that use the service locator.
当你把单件消灭完毕之后,应该重新检查一遍所有调用服务定位器的代码片段。

www.infoq.com

16. Business logic code that uses a service locator avoids becoming cluttered with directory lookup code, and so is easier to understand.
业务逻辑代码使用服务定位器避免目录查找代码变得混乱,因此它很容易理解。

www.ibm.com

17. Service locator implementations usually include a resource cache to avoid repeated lookups of the same resource.
服务定位器实现通常包括资源缓存,以此来避免对相同资源的重复查找。

www.ibm.com

18. It is much simpler for the service locator to be a singleton.
服务定位器作为集合的形式实现起来要简单的多。

www.ibm.com

19. First, he employed a “freemium” strategy, offering a free version of Car Locator for users to try out, in addition to the paid version of the app, for which he charged $2 at first.
首先,他采取了“免费增值”的策略,就是除了一开始收费2美元的“汽车定位器”程序的付费版本之外,还提供一个免费版让人试用。

article.yeeyan.org

20. The service locator skips the JNDI lookup and uses the resource from the cache instead.
服务定位器略过JNDI查找并取而代之的使用缓存中的资源。

www.ibm.com

21. Therefore, J2EE 1.3 applications should not include the resource cache in their service locator implementations.
因此,在J2EE1.3应用程序中,服务定位器的实现不应该包含资源缓存。

www.ibm.com

22. Since the service locator is basically stateless, multiple components sharing the same instance is not a problem.
由于服务定位器基本上是无状态的,所以多个组件共享相同实例是没有问题的。

www.ibm.com

23. This is simple to apply to an existing application: just change the service locator implementation to disable or remove the cache.
将其应用于现有应用程序很简单:只要改变服务定位器实现去禁止或去除缓存。

www.ibm.com

24. Wherever there are singleton lookup in the legacy codebase, a small change is made to lookup the same component via the service locator instead.
凡是在遗留代码集中出现单件查找的地方,稍加修改即可换用服务定位器来查找同样的组件。

www.infoq.com

25. In general, choose familiar locator expressions and be consistent in script structure.
一般来说,选用熟悉的定位器表达式,并在脚本结构中保持一致。

www.ibm.com

26. A URI can be further classified as a locator, a name, or both.
URI可以进一步分为定位器、名称,或者二者兼具。

www.ibm.com

27. A URI can be further classified as a locator, a name, or both.
URI可以进一步分为定位器、名称,或者二者兼具。

www.ibm.com