Re: Help! I can't support normalization
Date: 15 Nov 2002 05:26:41 -0800
Message-ID: <51d64140.0211150526.104fd27c_at_posting.google.com>
mikharakiri_at_yahoo.com (Mikito Harakiri) wrote in message news:<bdf69bdf.0211081037.358377d3_at_posting.google.com>...
> "Paul Vernon" <paul.vernon_at_ukk.ibmm.comm> wrote in message news:<aqe3e2$ne8$1@sp15at20.hursley.ibm.com>...
> > "Paul" <pbrazier_at_cosmos-uk.co.uk> wrote in message
> > news:51d64140.0211070129.6fab7168_at_posting.google.com...
> > > OK then, what about complex numbers?
> > >
> > > Logically they are one "thing" so should you store them as "3+4i" in
> > > one column?
> > > Or as real part and imaginary part in two columns?
> > > Or even in two columns r, theta where z = r * e ^ theta?
> > > It's only for our convenience that we split them into two parts, the
> > > complex numbers with integer (real, imaginary) parts are countable so
> > > we could easily map them one to one with the integers.
> >
> > Don't confuse possible representations (read D&D) from the actual values
> > themselves.
>
> The question is if a representation spanning into 2 columns is
> legitimate.
I've been thinking about this some more and I think you can make an argument for keeping things like complex numbers in one column.
The reason being that a domain isn't just a set of values D but also a set of operators/functions on D^n. So for example your COMPLEX domain could have an operator that maps a complex value to the REAL domain (or some approximation of it) for |z| = sqrt(Re(z)^2 + Im(z)^2). Maybe other ones as well. Then all this functionality is encapsulated in your domain. If you stored the real and imaginary parts in two columns you'd have to store the operator essentially in the head of the DB user and reproduce it for any query where you needed it.
Paul. Received on Fri Nov 15 2002 - 14:26:41 CET