struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <>
Subject Re: DAO Addition to struts
Date Tue, 30 Jul 2002 16:50:52 GMT
I think the key difference is that DAO/JDO implementations bury the 
access method within the bean.  O/R mappers (that I have looked at) use 
a different mechanism (in Torque it's another set of classes [Peers], in 
OJB it's nothing! [actually it is something - but you have less 
class-bloat])  O/R tools focus on the mapping of heirarchies to/from 
objects/databases (be they RDBMS or ODBMS or ORDBMS).  DAO/JDO simply 
encapsulate all of the given behavior they "use".

With certain mappers you may or may not have to define your java 
classes/DDL for manipulation of your data.  Torque, for instance, will 
generate classes for you - and may generate DDL too (if you happen to 
use a DBMS it works well with).  Castor (I believe) can generate your 
classes.  OJB, as I eluded to, doesn't create your objects/DDL.  I think 
Thomas is working it up to this point, since many other mappers do this. 
 Currently he is somehow using Torque, from what I understand, to 
generate classes.  OJB is probably the least "intrusive" mapper I have 
looked at.  You create your classes to represent your model - build your 
database.  Then, you set up a "mapping file" (repository*.xml) and "ask 
OJB for objects" or "give OJB objects" - it "knows" (from the mappings 
you provided) how to acquire/update your objects.

Torque uses straigh procedure calls, as well as some bit of Criteria 
(last I knew) that you could use to build queries.  Castor/OJB support 
the notion of OQL (Object Query Language) of some form (I don't think 
OQL in OJB is perfect yet, but it's apparant Thomas is genuinely 
committed to the success of OJB - it will come!)

Actually, I think I lied about JDO.  I was reading a JavaWorld article 
on implementing JDO and the manipulation of data was decoupled from the 
objects themself.  I need to look into this pattern more.  JDO (in the 
form I saw in that article, at least) also makes use of an OQL of sorts.

So - to sum up - the "mappers" are very concerned with (precisely what 
they are named for) mapping - DAO/JDO don't (from what I understand) go 
to this depth of seperation of manipulation and storage (the behavior 
and data, respectively - just to be clear).  JDO, as well as (most) 
mappers, provide you with some form of OQL that enables you to 
select/update data in an "object-centric" way, rather than a 
"database-centric way" (OQL focuses on object relationships - not 
database relationsips [though it takes care of that too - behind the 

Hopefully my ramblings have been of some use :-) (and at least mostly 



Dan Cancro wrote:

>What's the difference between DAO frameworks and Object Relational
>Here's a list of things I was calling Object Relational Mapping Tools.  Are
>these the same things as DAO tools?  If not, what are the distinct parts of
>this business-to-db middle layer, and what are the distinctions?
>*Persistence Layer
>*Sun:Entity Enterprise JavaBeans
>Thought Inc:CoCoBase

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message