Factoring out the lookup code also lets us reuse it for other EJB references.
分解服务查找代码还可以将其重用于其他的EJB引用。
You might try to clean up this code a bit by packaging the key lookup code in a named template.
您可能希望将键查找代码打包在指定模板中,使代码更加清晰。
The common lookup code that we factored must be duplicated in every client where we want to use this pattern.
必须将这种分解后的常用查找代码复制到使用这种模式的每个客户端上。
This frees the developer from having to constantly write meaningless registry lookup code, such as that enforced by the JMX API.
这使得开发人员不用经常编写毫无意义的注册表查找代码,例如JMX API要求编写的那些代码。
Business logic code that USES a service locator avoids becoming cluttered with directory lookup code, and so is easier to understand.
业务逻辑代码使用服务定位器避免目录查找代码变得混乱,因此它很容易理解。
The next example introduces a slight improvement over the first method, in that we factor out the common lookup code into a separate method.
下一个实例较第一种方法稍做改进,将常用的查找代码分解成单独的方法。
The next example introduces a slight improvement over the first method, in that we factor out the common lookup code into a separate method.
下一个实例较第一种方法稍做改进,将常用的查找代码分解成单独的方法。
应用推荐