Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need your opinions on this !

 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

I've read this article about using DAO layer with JPA or not, and I want to share it with all of you.

http://jvarun.wordpress.com/2010/06/30/dao-with-jpa-and-service-layerejb3-session-beans-or-not/

So what do you think, use DAO layer or not ? I would appreciate it if some people who passed the exam give us their feed back.

Thanks !
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This statement is not clear

There is a lot of discussion on internet about whether to have DAOs or not with JPA and service layer or with session beans (which is the service layer).


Does that mean the debate is about

DAO + JPA ?
DAO + JPA + Service ?
DAO + JPA + Session bean ?
DAO + JPA Vs EJB3 ?

Some of the arguments also seem flaky. But I think the point of the article is to promote DAO usage and abstract it from a service layer.

What matters more is your opinion. Why do you think DAO + JPA is bad ?
 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Meaning: Some use SLSB as DAO, and some add another independent DAO layer in addition of using the SLSB.

SLSB(service+DAO) + JPA vs. SLSB(service) + DAO + JPA
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Keeping the DAO out of the component helps improve re-usability. I dont see any reason why the DAO should be opaque to others
 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does this also apply to Stateful session beans as well ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic