Subject: Session - > DAO - > CMP 2004-06-10 - By Koala
Back ashraf galal wrote:
> It is a good approach based on good OO design principles. It uses > ordinary java interfaces rather than special infrastructure such as > that associated with entity beans. > > > > DAO uses an abstraction layer of ordinary java interfaces between > business logic and persistence components. > > The implementation of this interfaces handle persistence logic. > > > > Entity beans provide a similar abstraction between business logic and > persistence storage, but they lock us into one way of accessing data > and one particular O/R mapping solution. > > > > DAO pattern leaves us a choice, we can use JDO, JDBC, or entity beans > to implement DAO interfaces. > > > > With DAO, we can work inside or outside an EJB container, so we can > use same DAO implementations in any location, that means flexibility. > > > > We are not handle transaction or security, leaving this to business > logic components. > > > > You can find good information in the http://www.corej2eepatterns.com > <http://65.54.187.250/cgi-bin/linkrd?_lang=EN&lah =38c68bcbcd405911ed54e61b76d97d5e&lat=1086804232&hm___action=http%3a%2f%2fwww %2ecorej2eepatterns%2ecom> > > > > DAO can be used anywhere in a J2EE application. > > > > > > > Ashraf Galal > (416)804-8359 > > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- > Free yourself from those irritating pop-up ads With MSN Premium > <http://g.msn.com/8HMBENCA/2734??PS=47575> Get 2 Months FREE*
So, if my application use only EJB for persistence it makes no sense use DAO.
But, as you said above, if this is not the case (I have persistence layer implemented in EJB, SQL, JDO etc) I can use this solution.
At this point the question is: is it possible have an application with a persistence layer implemented with EJB, SQL, JDO, Hibernate and so on?
I know that in some EJB application could be useful use SQL for BULK operations. In this case what should be the approach? I mean, is DAO sufficient for abstraction or I need others patterns?
Again, is it possible use EJB, JDO and Hibernate (or other persistent mechanism) at the same time? If, so can you tell me an example?
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|