Re: Translating constraints to RM Terms

From: Paul <paul_at_test.com>
Date: Mon, 06 Jun 2005 11:41:32 +0100
Message-ID: <42a4285d$0$8719$ed2619ec_at_ptn-nntp-reader02.plus.net>


Marshall Spight wrote:
> But I think I must take exception to your claim that we are defining
> one domain in terms of another. And this rather gets to the heart
> of a question that's been buzzing around the back of my head
> for a year or two, namely: just what is the relationship between
> types and constraints?
>
> And I in fact have a tentative answer, which is that they are,
> respectively, the compile time and run time behavior of the
> variables. (Alternatively, the static and dynamic behavior
> of the variables.)

Here's an example to think about: I create a domain/type called "Number" which contains real numbers (maybe chopped off at some min/max values and some level of decimal places or significant figures). I make a column with this as the type. Then I add a column constraint like "round(col) = col" i.e. the value must be an integer.

Is this functionally identical to creating an "integer" type and using that?

To go further, imagine a universal type that was a union of the set of every possible type you could want. You set every column to this type and then have column constraints to restrict each column to the values you want.

Maybe this would link in with the thread on NULLs in that your universal type would only need a single universal NULL?

Note: I'm not seriously advocating this, just arguing a logical point to see if it reaches an absurdity.

Paul. Received on Mon Jun 06 2005 - 12:41:32 CEST

Original text of this message