title: what's a clean and efficient way of connecting objects to each other
body: <p>Feels like a question that has been asked before but I'm not exactly sure how to properly word it in a google search. Say I have a MainWindow object and in that object I define several objects PanelA, PanelB, PanelC and PanelD. What's a good way of connecting these objects to each other without having constructors that look like this </p>
  
  <p><code>PanelA(PanelB* b, PanelC* c, PanelD* d)</code> </p>
  
  <p>Would you suggest to just pass them all in through the main class like so </p>
  
  <pre><code>PanelA(MainWindow* mw)
  {
      b=mw-&gt;b; c=mw-&gt;c; d=mw-&gt;d;
  } 
  </code></pre>
  
  <p>Or is there better ways to structure my classes. What's this problem known as in general, so that I can google this stuff myself.</p>