db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Manske, Michael" <Michael.Man...@dat.de>
Subject RE: different internal variable names
Date Mon, 04 Aug 2003 09:41:14 GMT
hi,

i knew that such a discussion would come up and it depends on the point of
view of each indivual user. :)

> I don't know, I think I would Torque rather see more tightly coupled 
> with the RDBMS and dump the XML schema entirely.
if you have control over database structure and changes of the database
structure, then you will
perhaps prefer a strict coupling. But if not (like me), you will always
prefer loose coupling to be more independent of changes made by another dev
team. 

> My RDBMS already has a schema, which would be the metadatabase in the 
> systems tables. So why create another definition in XML of the same 
> database and tables?
If you have to support different RDBMS the metadescription in some "system
tables" will get useless.

> Torque's capability of abstraction of the RDBMS-specific 
> isssues comes 
> in quite handy here. The process could be automated by having Torque 
> generate the XML definition from a JDBC conncection, and then 
> generate 
> the om from that XML, but I haven't tried that yet.
Thats what i'm talking about, we are working with torque this way because we
have to deal
with a couple of already existing databases.
And yes, torques abstraction is somewhat of handy - thats why we use it. :-)

Loose coupling means among other things to hide the physical database
structure completely from the objects, which have to access the database. A
layer (like torque) will then act as mediator between objects and database.
So if you would have problematic identifiers like "short", you would be
easily able to map them to another name, which could then be used in java
objects, e.g. map "short" to "short_descr".
There is already some kind of support for this but at the moment it isn't
suitable at all.

I guess torque is so popular because of his abilities to generate more or
less useable code and the usage of a xml schema at runtime (respectively at
application startup) would possibly be contradictory to the generator BUT it
would also provide more independency from used database structure.

I'm not sure wheter this is a mainly intention of torque but i would be glad
if the devs would expand
support for loose coupling (at least for mapping of table/column names to
java names) in future versions...

regards,
Michael

PS: pros and cons of loose coupling will always be a matter of opinion


> -----Original Message-----
> From: Michel Beijlevelt / Lucka [mailto:mbe@lucka.nl]
> Sent: Monday, August 04, 2003 9:38 AM
> To: Apache Torque Users List
> Subject: Re: different internal variable names
> 
> 
> Howdy,
> 
> I don't know, I think I would Torque rather see more tightly coupled 
> with the RDBMS and dump the XML schema entirely.
> 
> My RDBMS already has a schema, which would be the metadatabase in the 
> systems tables. So why create another definition in XML of the same 
> database and tables? Now you manually have to keep the XML schema and 
> the actual metadatabase consistent which is tedious and 
> error-prone; of 
> course this is less of an issue if you have little changes in your 
> schema 's.
> 
> Torque's capability of abstraction of the RDBMS-specific 
> isssues comes 
> in quite handy here. The process could be automated by having Torque 
> generate the XML definition from a JDBC conncection, and then 
> generate 
> the om from that XML, but I haven't tried that yet.
> 
> gr. Michel
> 
> Manske, Michael wrote:
> 
> >As far as i know torque offers no solution for that issue, 
> you will have to 
> >change your templates. 
> >It's one disatvantage of torque that it doesn't provide 
> loose coupling
> >between
> >database and java objects. In my opinion it would be better 
> if torque would
> >use the xml schema at runtime to map java names on 
> table/column names.
> >
> >regards,
> >Michael
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message