aspose file tools*
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes DAO Layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "DAO Layer" Watch "DAO Layer" New topic
Author

DAO Layer

Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
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,

SCJP, SCWCD, OCMJEA, OCEEJBD, OCEJPAD, TOGAF® 9 Certified, OCEJWSD
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
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

Joined: May 26, 2003
Posts: 30938
    
158

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!


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Nilessh Ganu
Ranch Hand

Joined: Dec 22, 2009
Posts: 100
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.


Nilesh
SCJP SCWCD OCMJEA
Luay Abdulraheem
Ranch Hand

Joined: May 18, 2011
Posts: 65
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.
 
Don't get me started about those stupid light bulbs.
 
subject: DAO Layer