• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DAO Design pattern

 
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 148
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic