Skip to content

Commit 9512f3e

Browse files
committed
Closes iluwatar#436. Adds criticism to service locator pattern.
1 parent 4ca205c commit 9512f3e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

service-locator/README.md

+7
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ improves the performance of application to great extent.
3333
* lookups of services are done quite frequently
3434
* large number of services are being used
3535

36+
## Consequences
37+
38+
* Violates Interface Segregation Principle (ISP) by providing pattern consumers with an access
39+
to a number of services that they don't potentially need.
40+
* Creates hidden dependencies that can break the clients at runtime.
41+
* Limits object composability by stopping the clients to specify needed dependencies for different objects instantiation.
42+
3643
## Credits
3744

3845
* [J2EE Design Patterns](http://www.amazon.com/J2EE-Design-Patterns-William-Crawford/dp/0596004273/ref=sr_1_2)

0 commit comments

Comments
 (0)