Proper Design
- From: "John" <j_stus@xxxxxxxxxxx>
- Date: Thu, 22 Feb 2007 20:51:54 -0500
Hi there,
I am writing a simple program that will connect to database.
Database has 2 tables, let's call them father and child.
This is one to many relationship.
I would like to create corresponding classes for each table.
Each class would have functions Insert, Edit, Delete
I would like to find some information how to properly design my classes.
I used to program in php and delphi.
So I used to create separe class that corresponded to each table in
database.
In Father class I used to crate an array of child.
whenever Father was inserting new record to database, it was also inserting
corresponding record(s) into child.
I can easly do it, but would like to find out what is the best way to do it.
For instance, if there are 2 tables in database (father and child)
Father has
Id Integer
FatherName String
Child has
Id Integer (corresponds to father Id)
ChildName String
How to design 2 classes fot both tables?
Thanks,
John
.
- Follow-Ups:
- Re: Proper Design
- From: RobinS
- Re: Proper Design
- From: Spam Catcher
- Re: Proper Design
- Prev by Date: Re: zero element array creation
- Next by Date: connection close problem
- Previous by thread: exception using HTTPWebRequest with SSL
- Next by thread: Re: Proper Design
- Index(es):
Relevant Pages
|