This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

DAO Layer  RSS feed

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

If one uses his session bean as a DAO, and not introducing an additional DAO layer. I actually saw this in almost every example about Session Beans + JPA.

1) Is this a best practice, as the Java EE 5 tutorial doesn't add an additional DAO layer ?

2) If so (No additional layer), then in Component diagram, should the session beans be in Business or Integration tier ?? or should the facade be in one layer and the implementation in another ?

P.S.: In Cade's solution example, he introduced some DAO objects in the integration tier in his Component diagram, but were not shown in the Class diagram !

Thanks,
 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I mean I saw all the examples, even in the Java EE tutorial like this:

JSF ==> BackingBean ==> Session Facade ==> Session Implementation (DAO is here) ==> JPA

OR :

JSF ==> BackingBean ==> Session Facade ==> Session Implementation ==> DAO (additional layer) ==> JPA

Hope that this might be my last question about the assignment
 
author & internet detective
Sheriff
Posts: 38564
654
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's correct both with and without the DAO. It is a design preference. What's not correct is omitting it from the class diagram when it is used in the sequence diagram!
 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Luay Abdulraheem wrote:I mean I saw all the examples, even in the Java EE tutorial like this:

JSF ==> BackingBean ==> Session Facade ==> Session Implementation (DAO is here) ==> JPA

OR :

JSF ==> BackingBean ==> Session Facade ==> Session Implementation ==> DAO (additional layer) ==> JPA

Hope that this might be my last question about the assignment



Luay, I didn't observed any examples of backing beans accessing the JPA in Java EE 5 tutorial.
Could you please name the section so that I can refer it? It will be useful to me as I don't have experience in JSF.
 
Luay Abdulraheem
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For example, in the Java EE 5 tutorial case studies there is The Duke's Bank Application.

The CustomerBean component (Backing bean) uses @EJB annotations to inject references to the enterprise beans. In the enterprise beans implementation, the EntityManager uses the Entities to invoke database operations. There is no additional DAO layer in that example and many others all over the web.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!