title: How to verifying a Class has all properties configured before being used?
body: <p>I'm wondering what the best approach is to verify that a class has all the required details before it can be used.</p>
  
  <p>For example say I have a <code>Book</code> class and I want to pass in a set of properties about the book to the <code>Book</code> constructor.</p>
  
  <pre><code>Book book = new Book(bookProperties);
  </code></pre>
  
  <p>What I want to make sure that <code>BookProperties</code> is complete, i.e. has all the information.</p>
  
  <p>Let's say in this example I have the following:</p>
  
  <ul>
  <li>Book Title</li>
  <li>Book Author</li>
  <li>Book Original Publishing Date</li>
  </ul>
  
  <p>One way is that I could create a default constructor that only accepts all 3 items:</p>
  
  <pre><code>BookProperties bookProperties = new BookProperties("2001: A Space Odyssey",
                                                     "Arthur C. Clarke",
                                                     1968);
  </code></pre>
  
  <p>Now this is ok, if we only have three values, but say my class has 10 or more properties that need to be initialized by the user before the <code>Book</code> class can be created.</p>
  
  <p>One thing I was thinking was having a method in the BookProperties called <code>isValid</code>. Then in the constructor of the <code>Book</code> class I would see if <code>bookProperties.isValid</code> and assert if the return is false.</p>
  
  <p>Is this a good idea or am I going about this all wrong?</p>