Design question: Should the client both create the session and the socket?

Posted by the_drow on Stack Overflow See other posts from Stack Overflow or by the_drow
Published on 2010-05-14T06:16:14Z Indexed on 2010/05/14 6:24 UTC
Read the original article Hit count: 200

I have three classes:

  • Client
  • Session
  • Socket

Both Session & Socket depeand on the Client to create both objects.
A Session depeands on a Socket and no sockets are created without a session. Should the Client have a function that creates a Session pubically and a Socket privately?
Doesn't it violate the law of demeter?

© Stack Overflow or respective owner

Related posts about language-agnostic

Related posts about design