Skip to content

Server::createConnection breaks SRP #44

Closed

Description

@SamMousa

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?

Activity

  1. clue commented on Jul 12, 2016

    @clue
    Member

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

  2. SamMousa commented on Jul 12, 2016

    @SamMousa
    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.

  3. clue commented on Jan 27, 2017

    @clue
    Member

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

  4. clue commented on Feb 8, 2017

    @clue
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions