db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Saravana Kannan <skka...@engr.uky.edu>
Subject Which one of these is a good design?
Date Wed, 21 Apr 2004 03:34:42 GMT
Hi,

  Since almost all of the people in this list have probably worked a lot with 
DBs, I pose this question hoping for some guidance -

I'm developing a WebApp and deploying it using Tomcat. I have several Entities 
that are represented as my own classes in the Business Logic layer and as Torque 
OM classes in the DB layer (there is also ofcourse a UI layer but it is not 
relevant in this question). Which one of these is a good design?

1. My classes extend the DB layer classes and to persist my objects, I do a 
myobject.save().

2. My classes dont extend DB layer classes, instead they have a method, say, 
toDB() which gives me the Torque OM representation of my object. To persist 
myobjects I do xyz=myobjects.toDB() then xyz.save().

Please guide me as I'm continuing development a half completed code written by 
someone else. The code is in alpha stage. It currently follows design 2, but I 
thought it would be better to follow design 1. What do you say?

~Sarav.

-- 
There are 10 kinds of people in the world,
those who know binary and those who don't.

---------------------------------------------------------------------
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