Re: Help understanding types

From: Bob Badour <bbadour_at_golden.net>
Date: Sun, 23 Nov 2003 16:06:01 -0500
Message-ID: <sL2dncHV3Y1OvFyi4p2dnA_at_golden.net>


"Jim" <nospam_at_please.com> wrote in message news:Cm8wb.981$dt2.117854_at_news20.bellglobal.com...
> Hello,
>
> I am reading through the 8th edition of "Introduction to Database Systems"
> and I am having some difficulty with the section on types. (5.3
> Representations vs. Types)
>
> "A nonscalar type is a type whose values are explicitly defined to have a
> set of user visible, directly accessible components. " ....
>
> "A scalar type is a type that is not non scalar." ...
>
> Date then goes on to explain that types can have several representations,
> and the representations can have components. Here is one example he
gave:
>
> TYPE POINT
> POSSREP Cartesian { X Rational, Y Rational};
>
> I don't understand the distinction between components that make up a
> representation, and components that make up a type. How can a value of
type
> 'Point' be scalar if I (as a user) can access the X and Y members?

It depends on what you mean by members. If you mean members as references to internal structural components, then you are talking about a non-scalar type. If you mean members as operations, then the X and Y operations reveal nothing about the internal structure of the type's actual representation.

> Doesn't
> this exactly satisfy the definition of a scalar type as "A type whose
values
> are explicitly defined to have a set of user visible, directly accessible
> components".? (Aren't the X and Y co-ordinates above components, user
> visible, and directly accessible?)

They are components of a possible representation, but may not be a component of the actual representation at all. Since they are operations, one can argue whether anything is directly accessed.

> The explanation given in the book isn't entirely clear to me, so if
somebody
> else could put it in different words I would be grateful.

The thing to keep in mind is X and Y are operations and not actually components. Received on Sun Nov 23 2003 - 22:06:01 CET

Original text of this message