Re: The Foundation of OO (XDb)

From: Bob Badour <bbadour_at_golden.net>
Date: Tue, 18 Jun 2002 21:09:38 -0400
Message-ID: <3TQP8.75$vR.10520677_at_radon.golden.net>


"Topmind" <topmind_at_technologist.com> wrote in message news:4e705869.0206181620.7de79fb0_at_posting.google.com...
> > > > > > Why not assume user-defined type support? I assume it.
> > > > >
> > > > > Do you mean "media format types"? I did not define
> > > > > nor limit who can change what. That is an orthogonal
> > > > > issue IMO.
> > > >
> > > > No, I mean user-defined type support such that Video is a data type.
> > >
> > > "Type" often implies operations, like "play", "rewind", etc.
> >
> > These operations are application behaviours and not data behaviours. They
> > navigate among the images within a Video to choose the next image to > > display. The DBMS delivers data (ie. the requested Video value or Image) and

> > does not display.
>
> Do you mean "stream management"? I assumed that the DB would only
> store the file/BLOB and pass it to something else to manage
> the buffering, etc, of data transfer.

The dbms will store some valid physical representation of Video. It will derive other valid representations of Video and some appropriate binding to the application programming environment for each of them.

As a strongly typed system, we won't necessarily have to deal with BLOB.

> > > > I can see that. Video has multiple possible representations. Why
force
> > > > anyone to choose? Why not support all the possible representations
as

> >  one

> > > > logical type?
> > >
> > > Because fat types don't belong in databases IMO.
> >
> > Fat in what sense? In adequately supporting all possible representations of
> > a type? I think that does belong in a dbms.
>
> What is the "type" you have in mind? Presentation type? (movie,
> music, still images, mixed....), Format type?
> (Mpeg, MP3....), content classification
> (drama, comedy....)?

Data type. "Format" and "presentation" are both physical representation. The full set of operations supported would be up to the implementer of the data type.

As an aid to understanding the type model in _The Third Manifesto_, consider the value 1. Assuming the type model lacks Natural or Whole, 1 is an Integer value; it is also a Rational and a ComplexRational because Integer is a proper subtype of both of these types. Whether one physically represents the value as an unsigned integer of 8, 16, 32 or 64 bits, or as a two's-complement signed integer of 8, 16, 32 or 64 bits, or as a one's-complement signed integer of 8, 16, 32 or 64 bits, or in IEEE floating point as (0.5)*(2^1) to any given precision or as any other representation, they all represent the same value 1 of the same type Integer.

Consider two variables QQ and CC with declared types Rational and ComplexRational respectively. Since Integer is a subtype of both Rational and ComplexRational, one can assign the value 1 to both of these variables. While the variables have different declared types, they both would contain representations of the same value of the same type, namely representations of the Integer 1.

If one compares the two variables in this state, they are equal. If one evaluates the Magnitude operation or the RealPart operation on CC, the result of the operation is likewise the Integer 1. If one evaluates the Phase operation or the ImaginaryPart operation on CC, the result of the operation is the Integer 0.

If we evaluate the SquareRoot operation on each of the variables assigning the result back to the respective variable, the value represented in each variable remains the Integer 1.

If we evaluate the Negate operation on each of the variables assigning the result back to the respective variable, the value represented in each variable becomes the Integer -1.

If we evaluate the SquareRoot operation on each of the variables assigning the result back to the respective variable, the value represented in CC becomes the ComplexRational value with RealPart=0 and ImaginaryPart=1 while the other assignment throws an exception. (One cannot assign a value whose most specific type is ComplexRational to a Rational variable.)

However, if we evaluate the SquareRoot operation on QQ assigning the result to CC, the value in QQ remains the Integer -1 and the value in CC becomes the ComplexRational value with RealPart=0 and ImaginaryPart=1.

Physically, the type implementer can physically represent Integer values using any of the representations I listed above or even others, and must provide conversions to and from the declared possible representations.

Because the Integer type declares possible representations in a variety of formats, when you bind one to a variable in your program, the programming language can use the representation suitable for the variable.

I really think the model has huge potential, and if I were smart, I would be busy writing a dbms that supports it instead of posting messages on usenet. <g> Received on Wed Jun 19 2002 - 03:09:38 CEST

Original text of this message