I am working on a project which comprises a web site and some backend processes.
The program architecture is layered into following la
Layer 1. web frontend, backend processes
Layer 2. business logic (for web frontend only)
Layer 3. DAO
Layer 4. persistence layer
DAO is supposed to be a common module to handle all the data access logic for upper layers.
Maven is used for the project management. The dependencies are set via pom.xml.
Web frontend is deployed into JBoss, while backend processes is a standalone java application.
The question is "Should modules in Layer 1 and Layer 2 provide the database connections to DAO? Or let DAO do the database connection itself?"