Re: Abstract Data Types
Date: Mon, 23 Apr 2001 11:45:23 -0700
Message-ID: <3AE47843.EA321F9A_at_informix.com>
Robert Schiller wrote:
> In the article Thirty Years of Relational: Extending the Relational
> Model by C.J. Date, Date talks about ADTs. What does he mean by
> abstract data types in the context of the relational model?
CREATE TABLE Movies (
Abstract Data Types are things like 'Movie_Title', Period, ST_Point, Video etc.
None of these things is likely to be present in a DBMS product as it installs.
There are likely to be a great many of them (spatial, temporal, mathematical,
document, digital signal, etc) and many are application specific (two strings, "The
Sting" and "Sting, The" are equivalent "movie titles" but are not the same
VARCHAR(64) strings) or algorithmically specialized (geographic projection, compare
finger-prints, etc).
The idea is that each of these "things" can be modeled (pretty much) as an
object-class. There are already standards for embedding Java classes into modern
DBMS products (SQL-J) and for surfacing the methods implemented in this class as
expressions in the query language. Thus:
SELECT M.Title, M.Release_Date
FROM Movies M, Stars S
Title Movie_Title NOT NULL,
Release DATE NOT NULL,
Showing_For Period NOT NULL,
Cinema ST_POINT NOT NULL,
Clip Video NOT NULL
( PRIMARY KEY ( Title, Release ) )
);
WHERE S.Name = new PersonName ("Bergman", "Ingrid")
AND Face_In_Video ( M.Clip, S.Mug_Shot)
AND new Circle ( M.Cinema, "10 Miles").Contains( new ST_Point (:X, :Y))
AND M.Showing_For::Overlaps ( CURRENT )
ORDER BY 2, 1;
+--------------+--------+ | 'Casablanca' | 1941 | +--------------+--------+