Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server::createConnection breaks SRP #44

Closed
SamMousa opened this issue Jul 12, 2016 · 4 comments
Closed

Server::createConnection breaks SRP #44

SamMousa opened this issue Jul 12, 2016 · 4 comments

Comments

@SamMousa
Copy link

Shouldn't a ConnectionFactory be passed into Server::__construct instead of having a hardcoded classname in createConnection?
According to the single responsibility principle usage of an object should be separate from its construction right?

@clue
Copy link
Member

clue commented Jul 12, 2016

I think this makes sense 👍 Out of curiosity, do you have any practical use case for this?

@SamMousa
Copy link
Author

@clue Yes I do, since it is hard to get traction for changing the ConnectionInterface (since not all connections have a port), it makes sense to have different connection interfaces and different underlying implementations. This would allow you to use such a different connection implementation without changing the server.

@clue
Copy link
Member

clue commented Jan 27, 2017

Ping @SamMousa, what do you think, is this and #47 still relevant now that #65 is in? 👍

@clue
Copy link
Member

clue commented Feb 8, 2017

I believe this has been addressed via #65. Closing this due to a lack of feedback. If you feel this problem persists, please comment on this and we can reopen this 👍

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

No branches or pull requests

2 participants