Service Locator Design pattern is one of the best design patterns for those folks have a hate and love relationship with EJB. If you are a J2EE developer for long you must have used or heard of Service Locator Design Pattern.
The Service Locator Design Pattern solves duplication of code used for JNDI lookup of objects by abstracting the complexities and network dependencies into a single Service Locator class. This service layer pattern can be used for storing lookup values for all services and provide it on request. A caching mechanism can also be incorporated within the service to enhance performance as the JNDI lookup is made once only.
OTN publised a sample application for Service Locator Design Pattern that can be used as a reference application.
9:11:36 AM
|