Skip to content

Adds criticism to a Service Locator and Singleton patterns.#500

Merged
iluwatar merged 3 commits into
iluwatar:masterfrom
dmitraver:master
Oct 18, 2016
Merged

Adds criticism to a Service Locator and Singleton patterns.#500
iluwatar merged 3 commits into
iluwatar:masterfrom
dmitraver:master

Conversation

@dmitraver
Copy link
Copy Markdown
Contributor

Fixes #436, #437.

Lists drawbacks of the Service Locator and Singleton patterns.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.08%) to 84.217% when pulling eea8785 on dmitraver:master into 4ca205c on iluwatar:master.

@dmitraver
Copy link
Copy Markdown
Contributor Author

@iluwatar

Hi! Please review once you have a time ;)

Copy link
Copy Markdown
Owner

@iluwatar iluwatar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@dmitraver
Copy link
Copy Markdown
Contributor Author

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.

On 17 Oct 2016, at 22:15, Ilkka Seppälä notifications@github.com wrote:

@iluwatar requested changes on this pull request.

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


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@dmitraver
Copy link
Copy Markdown
Contributor Author

@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?

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage decreased (-1.2%) to 83.079% when pulling b66e8ec on dmitraver:master into 4ca205c on iluwatar:master.

@iluwatar iluwatar merged commit a37a29e into iluwatar:master Oct 18, 2016
@iluwatar
Copy link
Copy Markdown
Owner

@dmitraver looks good now. Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants