title: Using DAO pattern
body: <p>I am trying to use the DAO pattern in my multiple web app projects. I have three different web applications and they share two different databases. Each databases have number of tables.</p>
  
  <p>Now I am wondering how I can make my program modular by using best practice. I am thinking of making:</p>
  
  <ul>
  <li>DAO project which have two factory class for each database, DAO interfaces for each tables and DTO for each tables.</li>
  <li>Then in each web app project I am planning to write implementation code for DAO interface and necessary utility class for getting and closing the connections.</li>
  </ul>
  
  <p>Is this approach good? The doubt/problem i am having is with this design if I am going to ship any one of the project I have to ship DAO project also but that will contain unnecessary info about other databases.</p>
  
  <p>Or will it be good to attach all necessary DAO in web app itself? If so then I have to write same DAO ode for each web app. </p>
  
  <p>Hope anyone can provide me the clear path for this DB connection using DAO pattern.</p>