title: Program Design - Package by Feature vs. Layer or Both?
body: <p>I am in the design stage of a web application that allows users to create requests of work and the workers to put time against those requests. The application will also have reporting capabilities for supervisors to get daily totals, reports, and account for time spent, "cost allocation".</p>
  
  <p>Applications I've worked on in the past have been designed using the package by layer approach. I'm thinking it would be more efficient to use a package by feature design and I have a question about this design.</p>
  
  <p>What I am currently thinking for the packages by feature:</p>
  
  <ol>
  <li>Requests - CRUD the requests, assign then, add invoice numbers, etc...</li>
  <li>Work Time - CRUD daily time for users against requests, holiday, training, or meetings</li>
  <li>Cost Allocation - create reports, accounting things that accountants want ...</li>
  </ol>
  
  <p>The front-end will be Tomcat server and JSP. And, the back-end will be an Oracle database with EclipseLink doing the persistence. </p>
  
  <p>My question:</p>
  
  <p>In my understanding of package by feature, the entities and DAOs would go into the package associated with them. Spreading out the persistence layer across several packages. Leaving packages to call entities from other packages. With all of the overlap is this really functional? There would be no isolation between the packages. What are the pros and cons to using package by feature? Would it be good design to go with an additional persistence layer? Or, do I have the understanding of this totally wrong?</p>