I’m playing around with JDBC, and I’ve noticed that there’s usually a manager file that interacts between the front end and the DAO.
I was wondering: why is this the case?
Is it bad form to have the front end directly interact with the DAO and call the methods?
The question isn’t very clear. If by “manager file” you mean “service”, I think that’s closer to the truth.
The reason is that usually there’s more work to be done than a single DAO call to accomplish a use case, so a service marshals all the objects that are required.
If there are any write operations, it’s typical that they either all need to succeed or fail together, so the service can own the transaction and manage the commit/rollback behavior.