Re: weak entity

From: Bernard Peek <bap_at_shrdlu.com>
Date: Tue, 8 Oct 2002 16:54:08 +0100
Message-ID: <z8Fj3lEg+vo9Ew5G_at_shrdlu.co.uk>


In message <Gnxo9.34396$m7.318065_at_vixen.cso.uiuc.edu>, Ashutosh Galande <galande_at_uiuc.edu> writes
>Hi,
>
>While modeling a real life system it seems that its almost always possible
>to convert a weak entity into a strong entity by adding an "ID" attribute to
>it. (where ID is an external unique number which might not be a natural
>descriptor/attribute of the entity but still can be used to identify each
>entity instance uniquely eg: flight ID, item ID, book No, etc) So is there
>any golden rule or guideline which states when an entity should be kept weak
>and when an external attribute should be/can be added to it?

Adding an ID field does not make the entity any stronger. The strength of the entity depends on the data and the ID field is not part of the data. The entity may appear stronger but this is an illusion. Remember that an entity is a description of the logical structure of the data not the physical implementation.

There is a golden rule. The ID field only helps if you can guarantee that it is unique and that a given ID value can only possibly identify one instance of the entity.

The uniqueness requirement is easily met with most modern database systems.

Making sure that a given ID value can only be associated with a single instance of the entity is hard. If you can solve this then your ID field is almost as effective as a natural key. It usually requires additional processing outside the database system.

-- 
Bernard Peek
bap_at_shrdlu.com
www.diversebooks.com: SF & Computing book reviews and more.....

In search of cognoscenti



-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 80,000 Newsgroups - 16 Different Servers! =-----
Received on Tue Oct 08 2002 - 17:54:08 CEST

Original text of this message