• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DAO Layer

 
Luay Abdulraheem
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
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34669
366
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!
 
Nilessh Ganu
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic