Meaningless Drivel is fun!*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DAO Layer
 
Similar Threads
Who didn't use SLSB for DAO?
Where do DAOs, Adapters belong to?
Question on MDB/Service Activator in Business Layer Component or Integration Layer Component.
Assignment question - integration tier within component diagram
Incorrect/missing UML notation for interface/implementation on component diagram