|
|
 |
Re: FN-FORUM: [OT] flippancy - What's the best development platform for creating Web 2.0 business applications?
date posted 22nd November 2007 12:03
>> Isn't this what auto-incrementing fields are designed for?
>
> No. They are just there to provide a possible key for any entity without
> a candidate key;
That's sort-of-what I meant. If all the data for an item is changeable,
then you need another key for the primary.
> keys for idiots and very useful too. Most entities have no
> suitable candidate keys (despite what they taught you at college). But
> when
> a candiate key presents itself as clear as daylight - use that instead
> if it
> can be conveniently indexed.
Of course :)
> Suppose I had a link entity [which only exists to link two other
> entities in
> an many-to-many relation]. It has only two data columns which are both
> foreign keys to other entities. Why would I want to give it an
> autoincrement
> key? The natural key is the existing pair of columns; no need to
> complicate
> it further by adding another useless column.
Of course. I don't think anyone suggests using auto-increment IDs
everywhere. RoR doesn't require an ID column for many-to-many tables
either, for the same reason.
Anthony
--
www.fonant.com - Quality web sites
|
 |
|