title: Circular class references bad practice?
body: <p>Lately someone told me how circular references in the form of Class 1 calls Class 2 calls Class 1 is considered extremely bad practice, and I just can't get my head around that. I mean, if those classes are in 2 different projects I completely understand the problematic, but can that be bad if they're in the same project? And in some cases... how exactly are you to prevent that?</p>
  
  <p>For example: I have a server of some kind. Clients connect to it, and the Client, which derives from a socket, or holds it, takes care of the network stuff, and also some information like account id, etc. This Client calls a packet handler, when there's something new, and now the packet handler needs information from the client and has to send information back. I pass the Client to the packet handler, so it can call it's send functions, etc.</p>
  
  <p>The person who was concerned about this thought this was the mentioned bad practice, and tried to not do this at all, even though I've rarely seen servers, especially big ones, who kept all the packet handling inside the client class. Additionally, you might go further than the handler, and call more classes. It's a mess to keep all that inside the Client. So... is <em>this</em> really bad practice?</p>
  
  <p>If it is, how would one go around it? To get this done, you'd need a more or less complicated collection of objects in Client, that you can pass down, without having to call functions of Client again...</p>
  
  <p>Like I said, I can't really wrap my head around this "problem". Can someone help me out?</p>