title: Constructor requiring many input arguments
body: <p>My question concerns constructors in java. I've learnt that we should minimize the number of arguments to method including constructor. So if I have a class with requires a lot of input arguments to be created how do I best go about this. Should I </p>
  
  <p>A) Include them all in the constructor method signature:</p>
  
  <p>Example:</p>
  
  <pre><code>public MyClass(SomeThing A, Vector v, OtherThing B, int number.. etc.){
        // construct
  }
  
  ..
  
  MyClass c= new MyClass(..);
  
  c.doSomethingWithAllYouGot();
  </code></pre>
  
  <p>B) Can I construct only very little and then require the object user to add things before calling specific methods</p>
  
  <pre><code>public MyClass(SomeThing A){
        // construct
  }
  
  ..
  
  MyClass c=new MyClass(A);
  
  c.attributeVector(v);
  c.connectTo(B);
  c.setNumber(n);
  // etc.
  
  c.doSomethingWithAllYouGot();
  </code></pre>
  
  <p>The second variant seems more elegant and clean but allows for more errors if the class is incorrectly used.</p>
  
  <p>Or is there a problem with the the design of the class if it has too many input arguments?</p>