In several projects we have been using the following layers:Action (has 1 or more managers)Manager(has 1 or more Daos)DaoBut most of the time the manager only calls the dao. We do use the manager class to prepare the date to be sent to the db or to prepare the data to be sent to the action(is this a good practice?).What are the responsibilities of a Manager and of the Dao classes?Do we have to have a manager for every dao or can we just use the dao directly?How do I handle situations where I need to use the functionality implemented in several Managers?PS: I know that there is no golden hammer so I'll narrow it to the types of apps we do, generally webapps for banks.Thank you
What are the responsibilities of a Manager and of the Dao Layers
design patterns
What are the responsibilities of a Manager and of the Dao classes?The responsibility of the DAO is the abstraction over data access.  The responsiblity of the manager it to organize and execute the business logic of the application -- the manager uses the DAOs to accomplish this.Do we have to have a manager for every dao or can we just use the dao  directly?I would think you should be using the DAOs directly. Again, for the manager to accomplish its tasks, it might need to make use of several DAOs to manipulate data -- I don't see a problem with this.How do I handle situations where I need to use the functionality  implemented in several Managers?This could be a code-smell that you need to group together (refactor) certain logic or functionality into a new manager, or (although it might be extreme) another service layer on top of that to organize action among the managers.