Update README.md
Added service locator information
This commit is contained in:
parent
1cb62f543b
commit
112c719ee7
14
README.md
14
README.md
@ -21,6 +21,7 @@
|
|||||||
* [Facade](#facade)
|
* [Facade](#facade)
|
||||||
* [Flyweight](#flyweight)
|
* [Flyweight](#flyweight)
|
||||||
* [Proxy](#proxy)
|
* [Proxy](#proxy)
|
||||||
|
* [Service Locator](#service-locator)
|
||||||
* Behavioral Patterns
|
* Behavioral Patterns
|
||||||
* [Chain of responsibility](#chain-of-responsibility)
|
* [Chain of responsibility](#chain-of-responsibility)
|
||||||
* [Command](#command)
|
* [Command](#command)
|
||||||
@ -174,6 +175,19 @@
|
|||||||
* facilitate network connection
|
* facilitate network connection
|
||||||
* to count references to an object
|
* to count references to an object
|
||||||
|
|
||||||
|
## <a name="service-locator">Service Locator</a> [↑](#list-of-design-patterns)
|
||||||
|
**Intent:** Encapsulate the processes involved in obtaining a service with a strong abstraction layer.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
**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 expensicve 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.
|
||||||
|
|
||||||
|
|
||||||
|
**Typical Use Case:**
|
||||||
|
|
||||||
|
* When network hits are expesive and time consuming
|
||||||
|
* lookups of services are done quite frequently
|
||||||
|
* large number of services are being used
|
||||||
|
|
||||||
## <a name="chain-of-responsibility">Chain of responsibility</a> [↑](#list-of-design-patterns)
|
## <a name="chain-of-responsibility">Chain of responsibility</a> [↑](#list-of-design-patterns)
|
||||||
**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.
|
**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.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user