Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

DAO Layer

 
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
Posts: 40239
819
Eclipse IDE VI Editor Java
  • 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.
 
Shiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic