• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SCEA part 2 (old) DAO v CMP Bean

 
Greg Mandel
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have read many posts that mention the use of DAO. I was going to access the database using CMP Entity Bean. To me this is much simpler, potentially more efficient, and as the data model is simple, can't see that this will be a problem. My worry is that I am missing something here. Does this seems like a reasonable desgin. What would be the benefit of using Session Bean > DAO > Database?

Thanks for this. I am a "long time listener, first time caller"
 
Piotr Uryga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Greg Mandel:
Hi
I have read many posts that mention the use of DAO. I was going to access the database using CMP Entity Bean. To me this is much simpler, potentially more efficient, and as the data model is simple, can't see that this will be a problem. My worry is that I am missing something here. Does this seems like a reasonable desgin. What would be the benefit of using Session Bean > DAO > Database?

Thanks for this. I am a "long time listener, first time caller"


I have used CMP Entity Beans, but also Session Beans + DAOs in my assignment.
Look at Fast Lane Reader pattern description You'll probably came up with something. Also don't forget to search older topics on this forum - there are plenty of topics discussing CMP vs DAO issue.
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A DAO will hide the implementation. So, a DAO could front the CMP. Then, when the organization realizes that CMPs were rediculous and unworkable, they can switch to JPA, all behind the DAO, so it won't impact the application.

DAOs are always important.

-Cameron McKenzie
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic