Data Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am making a project that will use a custom object called account

i will be inheriting a base account type for each account

my problem is that each account will have custom data that needs to be saved some how

i cant make a table as the fields will be different

for example the information needed to describe a checking account will different from that needed for a
loan or a savings account

Is there some sort of a trick or some built in feature that i could use for this

i was going to use properties but then i dont know how to save that and it wont let me declare a static variable in the class

Please any suggestions would be grea

WStoreyII
 
Hi WS,

If you wish to maintain the data, you will have to presist it somehow. A
table in sql server is the only viable approach. You can certainly build a
table structure that accommodates different types of accounts in the same
row, notwithstanding that some of the data will differ from account to
account. A savings account and a checking account will have most columns in
common; for the others, either null or n/a will apply in one instance and
not the other. Moreover, the account type can dictate a subsidiary table,
one especially for checking, another for savings, linked back through a
foreign key - probably, the account #.

HTH,

Bernie Yaeger

WStoreyII said:
I am making a project that will use a custom object called account

i will be inheriting a base account type for each account

my problem is that each account will have custom data that needs to be saved some how

i cant make a table as the fields will be different

for example the information needed to describe a checking account will
different from that needed for a
loan or a savings account

Is there some sort of a trick or some built in feature that i could use for this

i was going to use properties but then i dont know how to save that and it
wont let me declare a static variable in the class
 
Hi WS,

In my opinion you are talking about polyphorisme

However that is not possible in a SQL type database (I find that a big
minor)

You probably want to say that a dog and a fish are animals, so I have two
animals with some special attributes however most is inherited from animal.

That is impossible to set in one table of a SQL database.

In a SQL database you can make an account table, and have to make for every
special specimen an seperate table with the extra attributes based on that
what the specimen has.

To put all the attributes in one table will mostly end in very long rows
with a lot of empty fields.

Just my thougth of it.

Cor
 
Cor

I completly agree and it seems that you understand my problem well

So what do you suggest? Serialization multiple tables becuase there are going to be about twenty accounts
and i dont think that twenty different tables with one to two rows is the answer regardless of the database mediu
you seem to be very knowledgable as to vb.net and have helped me in the past actually you and ken have combined answered almost ninety percent of my questions in this news group.

THanks again

WStoreyII
 
Hi WStory

I would go for those tables, because they describe the problem very well and
will not give no hare to change situations in future.

However watch what you do, there is no extra table needed for a man and a
woman because that is the attribute sex (read the rest before you think that
I know).

So when you can combine attributes on a higher level with a more general
describtion for that with an extra attribute which tell what it is (as with
my example man and woman), than mostly you can thight the problem down and
keeps only a few needed extra tables.

Cor.
 
Back
Top