Java Reference
In-Depth Information
<property name=" defaultObject" ref="uwrbusinessPOJO" />
<property name="jndiEnvironment">
<prop key="java.naming.factory.initial">
<prop key="java.naming.provider.url"> jnp://localhost:1099</prop>
<prop key=" java.naming.factory.url.pkgs">org.jboss.naming.client</prop>
It must be noted that the JndiObjectFactoryBean is a convenient way to look up JNDI
objects. But the recommended approach is to use a proxy factory bean that effectively
combines the service locator with dependency injection. You will learn about this strat-
egy in connection with the Business Delegate pattern.
• The Service Locator pattern abstracts the complex lookup mechanism associated
with service objects. This adds flexibility because the service clients are freed from
the lookup code.
• JNDI lookup is achieved by mere configuration with the Spring Framework.
• Performance is improved by the caching behavior of the Spring-based service
• Improved testability of service objects. With Spring, it is now possible to test POJO
business components outside the container without any alteration of the applica-
tion code base.
• It's easy to externalize service locator configuration.
Search WWH ::

Custom Search