wood burning stoves 2.0*
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "DAO Design pattern" Watch "DAO Design pattern" New topic

DAO Design pattern

Saritha Penumudi
Ranch Hand

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

Joined: May 26, 2004
Posts: 8

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.

Saritha Penumudi
Ranch Hand

Joined: Aug 18, 2003
Posts: 147

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
I agree. Here's the link: http://aspose.com/file-tools
subject: DAO Design pattern
Similar Threads
Using CMP2.0, JDO, DAO?
Cleared SCEA Part I with 87%
CMP and DAO...
Passed II/III with 95%
Struts and App Design question