[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnue-dev] Object-Relational Mapping?
From: |
Stanley A. Klein |
Subject: |
Re: [Gnue-dev] Object-Relational Mapping? |
Date: |
Sat, 18 Jan 2003 10:44:15 |
At 06:49 AM 1/18/2003 -0500, Reinhard Mueller <address@hidden> wrote:
>For example, a rule of normalization says that there are no repeating
>fields in a table. So for an address to have an address-line-1, an
>address-line-2, an address-line-3 and a city, you would have to make two
>tables, one containing the address-lines (one line per record) and
>another one for the city. That isn't practical. And that's where I guess
>we won't do normalization.
Reinhard -
I think you misunderstand what is meant by repeating fields. In your
example, address-line-1, address-line-2, address-line-3 and city are not
repeating fields.
The terms "repeating fields" or "repeating groups" actually refer to
features of the database models that the relational model replaced, the
network and hierarchical models.
Your example is not a good one, but using it I would say that you can't
have multiple values of address-line-1 for the same address. A better
example would be similar to what have been discussed as "master" records
and "detail" records such as a customer record and repeated sales records.
You can't put the master record and the repeated detail sales records (each
having the exact same fields) into the same relational table. You have to
do it in separate tables.
Another way of saying this is that the entry in a field of a record can
only be a value. It can't be a table of values. This really follows from
the basic structure of a relational database, i.e., as a collection of
simple tables.
Normalization is really a formal mathematical statement of some ideas that
avoid some strange anomalies that occur in non-normalized databases. One
example is where you keep the customer contact information in each sales
order. If the customer changes their address or other contact information,
you need to go back and change all the sales orders to have correct
customer contact information. If the database is normalized, you only need
to change the contact information in one place. There is also a "deletion
anomaly" involved here. If the only place customer contact information is
stored is in the sales orders, and you delete the only sales order because
the customer canceled the order, you lose the customer contact information.
In a normalized database, you can delete the sales order without losing
the customer contact information.
One other comment: Both you and Leandro apologized for not being native
speakers of English. Any misunderstandings in your e-mail discussion were
not related to proficiency in English, but to technical details and
technical terms that may not be widely known.
I think both of you do extremely well discussing technical issues in
English. If I had to try to conduct a discussion, technical or otherwise,
in either of your native languages, I couldn't get very far past "Good
morning teacher, the pen is on the table." :-)
Stan Klein