Thanks for your Input. Actually we want to show different reports which have details like
- Total no of Sellers
- Total no of purchase/non-purchase items and their values
- Total no of categorized/non-categorized items and their values
This information is also required in other reports. I can think of following possible solutions:
1) Create a generic ReportDAO which have queries used in all the reports. When we need to show a specific report, we can call the ReportDAO from our session bean, fill the XXXReportDTO and send it back to the client.
2) Create a generic ReportDAO which have queries used in all the reports. In addition to these queries, DAO also have functions to create, populate and return specific DTO. In this case, Generic ReportDAO will aslo work as what you called "Super DAO". It interact with session bean and internally use query functions to create and populate DTOs.
3) Similar to (2) where the superDAO will be a seperate Factory Class.
4) Create report specific DAOs which have a method to create report specific DTO.
Pls. suggest which option is the best.