Re: Objects and Relations
Date: 15 Feb 2007 02:02:01 -0800
Message-ID: <1171533721.394213.159730_at_h3g2000cwc.googlegroups.com>
On Feb 15, 3:54 am, Joe Thurbon <use..._at_thurbon.com> wrote:
> JOG wrote:
> > On Feb 14, 8:08 am, "David BL" <davi..._at_iinet.net.au> wrote:
>
> [...]
>
>
>
> > Nevertheless, for the benefit of other readers if nothing else, let me
> > state that Keith has hit the nail on the head.
>
> > 1) Lego blocks are /not/ the same. They always have a different
> > location attribute.
> > 2) Hence their x,y,z position attribute always identifies them.
> > 3) However this identifer is very hard to record and keep track of,
> > even though it exists.
> > 4) So we represent it with a surrogate identifer (which is hence just
> > an 'untrackable' attribute or, as others refer to it, an unfamiliar
> > attribute).
> > 5) OID's are hence not needed, and everything is just a value, as it
> > should be.
>
> I've found this thread really interesting, especially since it took a
> turn towards this topic. I'd like some feedback as to whether I'm
> understanding your point - I think I am.
Hi Joe, good to see you are still about.
>
> There seems to be some similarity between an OID (as I understand it)
> and a surrogate identifier as you describe it above.
Avoid this at all costs - I once stuggled with the ssme issue. An OID is not an attibute, whereas a surrogate is, and this is crucial. A value that represents a distinction in the real world must not be hidden.
Consider two twins identical in all possible ways (including name = suspend disbelief), apart from the fact they are clearly two different people (and hance have two different positions in space). They apply for a job, and the company database wants to keep track of them. A surrogate identifier such as an employee ID is used to distinguish them. They can now also be identified in the real world (at a meeting for example). Any changes in their details (perhaps one gets a pay rise) can now also be reflected in recorded propositions with their corresponding employee ID's. If we had used an internal OID we would not be able to make these distinctions in the real world.
>
> Would I be correct in saying that all OIDs are surrogate identifiers,
> but that not all surrogate identifiers are OIDs?
No. OID's are a programming mechanism - they are pointers.
>
> In particular, it seems that the difference is that, given some entity
> which we would like to model:
>
> (1) No two entities can share the same value for their surrogate
> identifier,
Correct, otherwise it would not identify them uniquely.
> BUT one entity can have two values for the surrogate identifier.
>
> (2) No two entities can share the same OID, AND no entity can have two OIDs.
>
> Cheers,
> Joe