Re: object algebra

From: Neo <neo55592_at_hotmail.com>
Date: 26 Feb 2004 12:56:01 -0800
Message-ID: <4b45d3ad.0402261256.783f8bd2_at_posting.google.com>


> > > And anyway, what's so hard about declaring something like
> > > enum EYE_COLOR { Blue, Green, Brown, Hazel, Gaping_Unblinking_Sockets }
> >
> > Violates basic set theory.
>
> Uh, I have a set with five elements. What's the supposed violation? Do you
> have a citation? Really, are you saying that enumerated types violate
> basic set theory?

You are correct. I wrongly overstated. Set theory allows a set of any things. The subtle deficiency is that the relationship between EYE_COLOR and its elements is weakened. For example, if we have EYE_COLOR = {Blue, Green} we can say Blue isa EYE_COLOR. Green isa EYE_COLOR.
but not easily say
Rock isa EYE_COLOR.

However, if we allow EYE_COLOR = {Blue, Gaping_Unblinking_Sockets, NA, UNK} we can no longer use isa, but instead a weaker relationship such as isValueOf. Thus Blue isValueOf EYE_COLOR. Gaping_Unblinking_Sockets isValueOf EYE_COLOR. NotApplicable isValueOf EYE_COLOR.
Unknown isValueOf EYE_COLOR.

If Unknown can be a value of EYE_COLOR, why can't Rock be a value of EYE_COLOR? In the above example, the weaker relationship kills inheritance. You could try to patch it with custom code, but it could not anticipate the nature of all new values added in the future (ie pink, not_sure, etc).

So are you in favor of NULLs (or its patches) and the resulting weaker realtionships? Received on Thu Feb 26 2004 - 21:56:01 CET

Original text of this message