title: DAO pattern when using hibernate
body: <p>We use hibernate in our application and like to use DAO pattern to implement the data layer of application. I have seen some suggestions on using ValueObjects/DTOs to return data from DAOs </p>
  
  <pre><code>public interface EmployeeDAO {
    List&lt;EmployeeDTO&gt; getEmployees();
  }
  </code></pre>
  
  <p>What is the advantage of returning ValueObjects/DTOs instead of returning hibernate domain objects as </p>
  
  <pre><code>public interface EmployeeDAO {
    List&lt;Employee&gt; getEmployees();
  }
  </code></pre>
  
  <p>Is it not a overkill to copy the data from hibernate object to value object and have two copies of same data in memory. What advantage does ValueObjects really add ? </p>
  
  <p>Are ValueObjects just preferred between business and view layers are should these be used in DAOs</p>
  
  <p>Thanks for any suggestions</p>
  
  <p>Siva</p>