title: Decoupling - OOP
body: <p>I have a simple question (working with Java). I have two classes, one represents a Document, a second represents a Word.</p>
  
  <p>The Document class needs to know some info about the words that is kept in Word. My question is, what's the best way to decouple the two classes? I have 2 options in mind:</p>
  
  <ol>
  <li><p>Have no connection between the classes, and each time I call a method in Document, I pass it an object of Word (so I have a third class with a main method that initiates
  both Document and Word).</p></li>
  <li><p>Declare a private object of Word inside Document. </p></li>
  </ol>
  
  <p>One thing to note, I only have one object for Word and one for Document. I don't create a new object for every new document or word. I store a list of the entire documents in Document, and a list pf the entire words in Word.</p>
  
  <p>Thanks!   </p>