we have tried this approach.

we got a base class to access de DB to brings general services to acces a DB
(convert ResultSet to diferente formats, write, read, id metods and others),
this class is abstract. Then each "kind particular issue related"  class
extends this class to do complex data access. for example.

We have to Handle Data and Metadata, so be have a DataBD and MetadataBD, in
this classes we isolate the functionality to acces that "kind" of
information, DataBD has 10 methods to rebuild Data (getRoutesDescription,
buildRoute,..) and so with MetadataBD. the classes that handled Data are
around 10 but their access to DB is made through the DataBD and so with
Metadata. To solve the problem of several acces from difrent class we build
a Singleton Pattern on the DataBD and MetadataBD.

When the access is much more particular we use another approach based on
Controlers and particular class related data access, but anyway this
particular classes extend the base class, thats why the base class should be
constructed carefully on a Framework style.



John Jairo Cortes Montoya
Research & Development Engineer
Open International Systems Corp.
============================
http://www.open-intl.com/
----- Original Message -----
From: "Velankar, Kirti" <[EMAIL PROTECTED]>
To: "Rose Forum" <[EMAIL PROTECTED]>
Sent: Wednesday, October 25, 2000 9:47 AM
Subject: (ROSE) Database related classes


>
> Hi,
>
> When we are designing classes for database access what is the right
approach
> ?
>
> 1. Create a class directly related with each database table.
> - It creates problems when we want a join of 2 or more tables.
>
> 2. In a small project what we had done was one class - for forming SQLs
> there were String type variables one for each SQL
> and a general method for executing the SQL , getting the  results
> back in a vector
> and a method for processing the results returned
> - When there are many tables this gets confusing
>
> Is there any better approach?
>
> Thanks in advance!!
> Kirti
>
> ************************************************************************
> * Rose Forum is a public venue for ideas and discussions.
> * For technical support, visit http://www.rational.com/support
> *
> * Admin.Subscription Requests: [EMAIL PROTECTED]
> * Archive of messages:
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
> * Other Requests: [EMAIL PROTECTED]
> *
> * To unsubscribe from the list, please send email
> *
> * To: [EMAIL PROTECTED]
> * Subject:<BLANK>
> * Body: unsubscribe rose_forum
> *
> *************************************************************************
>
>


************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: 
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to