Adds criticism to a Service Locator and Singleton patterns.#500
Conversation
|
Hi! Please review once you have a time ;) |
iluwatar
left a comment
There was a problem hiding this comment.
I would rephrase this sentence: "Limits object composability by stopping the clients to specify needed dependencies for different objects instantiation." To be honest, I don't know what it means.
I would like to add more consequences to Singleton. 1) Creates tightly coupled code that is difficult to test 2) It's almost impossible to subclass a Singleton
|
Yeah, I reread it also after a while and it doesn't ring a bell. I will make a change today and update my PR. Thanks.
|
|
@iluwatar I addressed your points. I removed the phrase that causes confusion cause its an edge case of singleton usage and its already described better in other two points. What do you think? |
|
@dmitraver looks good now. Thanks for your contribution! |
Fixes #436, #437.
Lists drawbacks of the Service Locator and Singleton patterns.