Should I add a method/constructor argument for an object that can be queried from another argument
<p>Assuming that I have this:</p>

<pre><code>public class A {
   private B b;

   public B getB() {
     return b;
   }
}
</code></pre>

<p>Now, I have a class that needs A and B.  The questions is, should the constructor be accepting only A, and I would then query B from A, or should the constructor be asking for both A <strong>and</strong> B?</p>

<p>Should it be this:</p>

<pre><code>public MyClass(A a) {
  this.a = a;
  this.b = a.getB();
}
</code></pre>

<p>or this:</p>

<pre><code>public MyClass(A a, B b) {
  this.a = a;
  this.b = b;
}
</code></pre>

<p>p/s: I think this is a rather noobish questions, but whatever.</p>

<p>p/p/s: Thinks this should have been a community wiki?  I don't have enough permission though. :/</p>
