Hi all. while I were stydying the service locator pattern, I encountered the following methd :
what this method do ? when we want to use the service locator pattern , we write some thing like: BeanHome = (BeanHome).ServiceLocator.getInstance( ).getHome("..", BeanHome.class); and there is also method called : protected String getId(EJBObject) throws ... also, what this method do ? (I am novice at patterns, ok). thanks.
Service Locator pattern basically used improving the application performance by minimising the number for JNDI lookup calls. From a servlet if you are calling n number of EJB's in the same EJB container, you have to do the n-number of JNDI lookups. To avoid that we are providing a wrapper(as Service Locator) to lookup up the jndi.