I have heared that people build J2EE application using DAO and DTO.
What are DAO and DTO used for?
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
Originally posted by Nicholas Cheung:
Data Access Object (DAO) is a pattern for accessing database. It encapsulates the *flows* for how you access the database. Thus, as a caller, you dont need to know how the DB is connected and access, you just know you are querying data from the DB, in regardless of what DB you are connecting, which driver you are using, etc.
Originally posted by Nicholas Cheung:
Data Transfer Object (DTO) is an object to hold data objects, which could be transferred across various tiers. It could be some domain objects obtained from database, it could be the result data set from MQ messages, etc.
Cheers, Sathya Srinivasan - SCJP 1.2, SCWCD 1.2, SCMAD 1.0
Co-Author of Whizlabs SCMAD Certification Exam Simulator and SCMAD Exam Guide Book
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Stan James:
I view DTO as a necessary evil, one of my last choices...
<a href="http://www-306.ibm.com/software/rational/bios/ambler.html" target="_blank" rel="nofollow">Scott W. Ambler</a><br />Practice Leader Agile Development, IBM Rational<br /> <br />Now available: <a href="http://www.ambysoft.com/books/refactoringDatabases.html" target="_blank" rel="nofollow">Refactoring Databases: Evolutionary Database Design</a>
Originally posted by Stan James:
I view DTO as a necessary evil, one of my last choices.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Originally posted by Scott Ambler:
You might find Encapsulating Database Access to be of interest. It compares and contrasts several options.
- Scott
Bruno Collet<br /><a href="http://www.practicalsoftwarearchitect.com" target="_blank" rel="nofollow">www.practicalsoftwarearchitect.com</a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Bruno Collet<br /><a href="http://www.practicalsoftwarearchitect.com" target="_blank" rel="nofollow">www.practicalsoftwarearchitect.com</a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Originally posted by Bruno Collet:
I do not see how a system made of multiple components and complying with SOA basic rules, can work without using DTO.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Bruno Collet<br /><a href="http://www.practicalsoftwarearchitect.com" target="_blank" rel="nofollow">www.practicalsoftwarearchitect.com</a><br />- The Paradox of Software Architecture: It is easy to make a complex architecture, but it is difficult to make a simple architecture.
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|