Hi, In the DAO design pattern it is mentioned that CMP are not usually used with DAO bcoz container does work of a DAO. It also mentioned that DAO can be used with CMP. I wanted to know in what scenarios the CMP would like to use DAO and how we would configure this in Deployment descriptor.
I would appreciate is you could give me some example.
Yes you are right, incase of CMP DAO pattern is not used but think of a scenario in which you are required to do some validations or you have to check data of some other table then only you have to persist the values, here you can call a DAO from a business method of CMP and if want to do some calculations with other values of a table, that can be done.
Joined: Aug 18, 2003
Thank you very much. But i did not clearly understood the concept. Does the CMP DAO is a normal java class which would lookup for a CMP and does validations on the data. If these validations are because of some business logic then why we would want to seperate that from business layer which we would be our session beans and create one more layer.