aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes DAO Design pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DAO Design pattern" Watch "DAO Design pattern" New topic
Author

DAO Design pattern

Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
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.

Thank you very much
Saritha
v Gupta
Greenhorn

Joined: May 26, 2004
Posts: 8
Hi,

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.

Cheers
Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147
Hi,

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.

Thank u
Saritha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DAO Design pattern