Thursday, 22 March 2018

1. Service locator design pattern


Service Locator design pattern.

1.     The service locator design pattern is used when we want to locate various services using JNDI lookup.
2.     Service Locator uses catching technique internally.
3.     For first time a service is required, Service locator lookups in JNDI and caches the service object.
4.     Further lookup for same service it picks from cache, so it improves performance of application.
5.     Following entities
a.     Service – Object, we are looking for
b.     Context – JNDI context save ref of service for lookup
c.     Service Locator – Get services by JNDI lookup catching the services
d.     Cache – To store the ref of services to reuse.
e.     Client – client invokes service ref via Service Locator







No comments:

Post a Comment

3. Java Program to create Binary Tree