struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eddie Bush <ekb...@swbell.net>
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 
scenes]).

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

Regards,

Eddie

Dan Cancro wrote:

>What's the difference between DAO frameworks and Object Relational
>frameworks?
>
>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?
>
>*Apache:Betwixt
>*Apache:ObjectRelationalBridge
>*Apache:Peers
>*Apache:Torque
>*ChiMu:FreeForm
>*JCorporate:Expresso
>*Persistence Layer
>*SourceForge:DataBind
>*SourceForge:jRelationalFramework
>*SourceForge:MiddleGen
>*sql2java
>*Sun:Entity Enterprise JavaBeans
>*Sun:DAO
>*Sun:JDO
>*Sun:JMX
>ChiMu:Form
>eQ!
>exolab.org:Castor
>Microsoft:ADO
>Objectwave:Jgrinder
>Thought Inc:CoCoBase
>Village
>Webgain:Toplink
>
>Thanks,
>Dan
>



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message