BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Object storage dilemma

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design
View previous topic :: View next topic  
Author Message
Joao Morais
Guest





PostPosted: Thu Apr 12, 2007 2:51 am    Post subject: Object storage dilemma Reply with quote



Hello,

I am designing an OPF and an issue was raised. Lets say that I have this
model:

TContact
+-TPerson
+-TCompany

TInvoice
Date: TDate;
Client: TContact;

My TInvoice storage will be at least something like this:

create table Invoice (
Id: Integer;
Date: Date;
ClientId: Integer);

But what about the client class? I can: create another field as a class
reference; or I can create a join between the invoice and the contact
tables in order to retrieve the client class.

Perhaps you say: the id is a unique value inside the whole database. I
agree and like this approach, but (I think) I will need an "instances"
table that will need to be queried or joined, in order to know where I
will find an instance -- in my sample, the Client instance.

Ok, I hope you got what I mean, and I'd like to know your experience in
this area, if you:

- have an instances table and uses join, or another query to know a
class of an Id;

- don't have an instances table but a class reference per table:
create table Invoice (
Id: Integer;
ClassId: Integer;
Date: Date;
ClientId: Integer);
so you query the Contact table (or create a join) to know the class;

- have one class id per object id:
create table Invoice (
Id: Integer;
ClassId: Integer;
Date: Date;
ClientClassId: Integer;
ClientId: Integer);

- another approach?

Thanks,
--
Joao Morais
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OO design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.