Re: integer id columns for all tables
- From: "Marshall" <marshall.spight@xxxxxxxxx>
- Date: 29 Aug 2006 05:22:57 -0700
Alexandr Savinov wrote:
Here are a number of principles for designing identifiers:
- An entity may well exist without properties but not without identifiers.
- An identifier is the first thing to be created before actually the
entity itself is created. In other words, we create an identifier and
only after that (and if it is really needed) the corresponding entity is
created.
- Identifiers have to be constant (in contrast to properties). If you
use a kind of system identifier then you are guaranteed then nobody can
change it or otherwise misuse.
- Identifiers should not be meaningful because they are intended to be
manipulated by the software rather than by users (with the exception of
some well known identifiers used for bootstrapping). So identifiers
should be hidden from the users.
- Identifiers should be defined before any properties exist. Such a
structure will have only identifiers for accessing empty entities. After
that we can add meaningful properties. This discipline can ensure the
separation between these two concerns.
- If you need uniqueness then use the corresponding constraint.
Frequently the need for uniqueness in a property leads to the conclusion
that it should be used as an identifier.
I couldn't find anything wrong with your sixth point. However the
others are all deeply flawed. You fail it.
Marshall
.
- References:
- integer id columns for all tables
- From: garhone
- Re: integer id columns for all tables
- From: Alexandr Savinov
- integer id columns for all tables
- Prev by Date: Re: integer id columns for all tables
- Next by Date: Functional Dependencies > Uniqueness Constraints
- Previous by thread: Re: integer id columns for all tables
- Next by thread: Re: integer id columns for all tables
- Index(es):