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