150 likes | 296 Views
OBJECTS OBJECT IDENTITY REFERENCE TYPES. Object identifier - oid. FILE SYSTEM. Data object. Object identifier - oid. DBMS. ?. FILE SYSTEM. Data object. Differences between URL and Oid. Oid. URL. Notions of equality.
E N D
OBJECTS • OBJECT IDENTITY • REFERENCE TYPES
Object identifier - oid FILE SYSTEM Data object
Object identifier - oid DBMS ? FILE SYSTEM Data object
Differences between URL and Oid Oid URL
Notions of equality deep equal :Two objects having the same type are defined, if and only if:
Notions of equality Shallow equal: two objects that have the same reference type ( if they both refer to the same object).
Notions of equality Example: create table frames (frameno integer, image jpeg, category integer); create table categories (cid integer, name text, lease_price float, comments text); create type theater_t as row (tno integer, nametext, address text, phone integer) create table theaters of theater_t; create table nowshowing (film integer, theaterref(theater_t), start date, enddate); create table films (filmno integer, title text,starssetof(text), director text, budget float); create table countries (name text, boundarypolygon, population integer, language text)
Notions of equality ROW(538, t89, 6-3-97, 8-7-97) ROW(538, t33, 6-3-97, 8-7-97) deep equal Shallow equal
INHERITANCE • Defining Types with Inheritance • Binding of Methods • Collection Hierarchies, Type Extents, and Queries
Defining Types with Inheritance Instance: THEATER tno integer Name text address text phone integer THEATER-CAFÉ Menu text tno integer Name text address text phone integer supertype subtype CREATE TYPE theatercafe UNDER theater (menu text)
Defining Types with Inheritance Note: • the inheritance mechanism creates rlationship between the subtype and supertype.(an object of the subtype is also considered to be an object of the supertype.) • The substitution priciple: given a supertype A and a subtype B, it always possible to substitute an object of type B into a legal expression written for objects of type A, without producing type errors. • Inheritance can also be used for atomic types, in addition to row types.
Binding of Methods Instance: INMAGE JPEG-IMAGE supertype subtype The display() method for IMAGE does not work for JPEG images!!! CREATE FUNCTION display(jpeg_image) RETURNS jpeg_image AS EXTERNAL NAME ‘/a/b/cjpeg.class’ LANGUAGE ‘java’;