title: Logic for family tree program
body: <p>I am creating a family tree program in Java, or at least trying to. I have developed several classes:</p>
  
  <ul>
  <li>Person - getters and setter for name
  gender age etc</li>
  <li>FamilyMember - extends Person getters
  and setters for setting parents and
  children</li>
  <li>Family - which consists of multiple
  family members and methods for adding
  removing members</li>
  <li>FamilyTree which is the main class
  for setting relationships.</li>
  </ul>
  
  <p>I have two main problems:</p>
  
  <p>1) I need to set the relationships between people. Currently I am doing:</p>
  
  <pre><code>FamilyMember A, FamilyMember B
  B.setMother(A);
  A.setChild(B);
  </code></pre>
  
  <p>The example above is for setting a mother child relationship.</p>
  
  <p>This seems very clunky. It's getting very long winded to implement all relationships. Any ideas on how to implement multiple relationships in a less procedural way?</p>
  
  <p>2) I have to be able to display the family tree. How can I do this? Are there any custom classes out there to make life easier?</p>
  
  <p>Thanks for your time...</p>