• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO usage

 
Tilak Mitra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People talk about using DAO's in the design. Are these DAO's alternatives to using Entity Beans or do they co-exist with entity beans in the architecture ? In other words are DAO's being used with Entity Beans typically ?
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They co-exist.
You can read about them here.
Did this help?
 
Tilak Mitra
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rufus,
I know that they can co-exist. My question was more in the lines of the problem at hand . In here, is it advisable to use DAO's from Session beans instead of CMP's ? Or a combination ?
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Value List Handler Pattern explains an instance when dealing with entity beans ( CMP or BMP ) just does not make sense. This pattern goes from the client to the datastore without using entity beans. The patterns people recommend putting a session bean ( session facade ) in front of the VLH.
Suppose that the value list returned a list of available rooms in a hotel. When you wanted to reserve a desired room using the entity bean for that room makes more sense.
 
Nishant Anshul
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
let me try this...
u use VLHdlr normally for read only data, so preferably not for ejbs...okay ..but it doesnt prevent u...i mean for scalability reasons u may have ejbs.
regarding DAOs and VOs in class diagrams, i think it again boils down to the questions posed by Rethna and Raj in earlier threads - whether there shud be tech depndcy. in class diag...i feel in 1st pass u conc on identidfying domain objects and gradually u can have J2EE dependent class provided the PROBLEM situation demands a J2EE soln (which in all likelihood would be the case... with SCEA exam )
Can we have more opinions here???
rgds,
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic