Address ADT
CREATE TYPE AddressADT (
street CHAR(50),
city CHAR(20),
EQUALS addrEq,
LESS THAN addrLT
FUNCTION fullAddr (a: AddressADT) RETURNS CHAR(100);
:z CHAR(10);
BEGIN
:z = findZip(:a.street, :a.city);
RETURN (….)
END;
DECLARE EXTERNAL findZip
CHAR(50) CHAR(20) RETURNS CHAR(10)
LANGUAGE C; );
Encapsulation is obtained by making methods public/private
Previous slide
Next slide
Back to first slide
View graphic version