Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Data Access Object & Value Object

 
Johny Sam
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What design pattern does the Data Access Object & Value Object match to?
Can some one help !
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Data Access Object (DAO) is used to encapsulate all data access (RDMS, OOMS, LDAP, XML...) in 1 object.
For instance, if your data are in a RDB, all the SQL code (select, update, delate) is within a DAO, and your application have to use this DAO in order to perform a db access
Many advantages... let's say, more OO, better for scalability (if you change the data from a DB to a LDAP just need to change the DAO accordingly ), easier to migrate from BMP to CMP etc..

A value object is a java class which represents data from the DB and is accessible without RMI calls.
When you perform a DB read, you store the result in Value objects. Each value object is loaded in memory and is available for futur calls.
Hope this is clear.
 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
In fact, DAO and VA are core J2EE design patterns. These patterns are mentioned at javasoft web site. Also, there is a book core J2EE Patterns.
 
Johny Sam
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much for clearing my doubts with DAO &VO.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!