Proper Design

Tech-Archive recommends: Speed Up your PC by fixing your registry



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


.



Relevant Pages

  • Re: Genealogical evidence and data model
    ... relation (in any database), ... child is Child A because we always uniquely ... we also always specifally identify as Father A. So if we trace back from ... but bottom line remains that once you've given someone 4 potential sets of parents, only one set at a time can be displayed on screen. ...
    (soc.genealogy.computing)
  • Re: Genealogical evidence and data model
    ... relation (in any database), ... child is Child A because we always uniquely ... we also always specifally identify as Father A. So if we trace back from ... so two fathers with unknown for type of relationship ...
    (soc.genealogy.computing)
  • Re: Genealogical evidence and data model
    ... but if the intermediate father is potentially one of ... relation (in any database), ... child is Child A because we always uniquely ... same name and other common identifiers. ...
    (soc.genealogy.computing)
  • Re: what are keys and surrogates?
    ... Let's consider a minimal genealogy database: every person has a father, ... a mother, and a name, but no other attributes. ... So references / oids can not only be useful in identification, ...
    (comp.databases.theory)
  • Re: is a relational db a god tool or not really worth it?
    ... father two children each or some four and others zero. ... The teleological problem is that the point of a database is ... When you let NULLs into your ... database you are leave manual work for later. ...
    (comp.lang.lisp)