To illustrate the difference between inheritance and delegation, consider the following code, which implements a rather poorly designed class called printer that supports the printing of documents:
Printer = POINTER TO PrinterDesc;
PrinterDesc =
RECORD
pageno: INTEGER; (* variable is private *)
PROCEDURE (p: Printer) PageNo(): INTEGER;
PROCEDURE (p: Printer) SetupNextPage
(VAR endOfDoc: BOOLEAN);
PROCEDURE (p: Printer) PrintPage;
PROCEDURE (p: Printer) PrintDoc;
END;
(The language used here is Oberon-2, whose sy
ntax bears a family resemblance to Object Pascal.
Rising transportation costs and the time-wasteful aspects of travel have focused corporate attention on expensive broadcast-quality videoconferencing systems.
BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin,
and dozens of other CMP publications—bringing
you critical news and information about wireless communication,
computer security, software development, embedded systems,
and more!