Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle8's new features - what are they
In article <3384753C.68F6_at_post3.tele.dk>, Finn Ellebaek Nielsen <ellebuk_at_post3.tele.dk> writes:
>
>OK, encapsulation is missing as well. What do you mean no methods? Take a
>look
>at the following example:
>
>CREATE TYPE Address AS OBJECT
>(
>street VARCHAR2(40),
>city VARCHAR2(30),
>state CHAR(2),
>zip CHAR(10)
>);
>
>CREATE TYPE Person AS OBJECT
>( first_name VARCHAR2(15),
>last_name VARCHAR2(30),
>addr Address,
>birthday DATE,
>MEMBER FUNCTION age() RETURN NUMBER
>);
>
>The Person object has the age() method (member funciton) attached.
>
>CREATE TABLE people OF Person;
>
>SELECT p.first_name, p.last_name, p.age(), p.addr
>FROM people p
>WHERE p.age() > 35;
>
>so the method age() is invoked on the Person object used in the people
table.
>
>Cheers,
>
>Finn
>
>--
>
>-------------------------------------------------------------------------
Can we define age() member functions for other ADT's? I don't think so. No polymorphism!
-Chris.