You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Applicability:** The service locator pattern is applicable whenever we want to locate/fetch various services using JNDI which, typically, is a redundant and expensive lookup. The service Locator pattern addresses this expensive lookup by making use of caching techniques ie. for the very first time a particular service is requested, the service Locator looks up in JNDI, fetched the relavant service and then finally caches this service object. Now, further lookups of the same service via Service Locator is done in its cache which improves the performance of application to great extent.
184
+
185
+
**Typical Use Case:**
186
+
187
+
* When network hits are expensive and time consuming
188
+
* lookups of services are done quite frequently
189
+
* large number of services are being used
177
190
178
191
## <aname="chain-of-responsibility">Chain of responsibility</a> [↑](#list-of-design-patterns)
179
192
**Intent:** Avoid coupling the sender of a request to its receiver by giving more than one object a chance to handle the request. Chain the receiving objects and pass the request along the chain until an object handles it.
0 commit comments