[Oberon] Class Methods Vs. Procedure variables in Records
Josef Templ
josef.templ at gmail.com
Wed Jan 4 14:11:32 CET 2017
Excellent summary by Andreas.
In addition I would like to point out that the motivation of
moving from Object Oberon's class syntax to the Oberon-2 syntax was to
avoid many forward references. The other motivation was of course to
make the syntactical differences smaller by removing additional keywords.
The overall compiler changes for Oberon-2 were smaller than for
Object Oberon, if I remember correctly.
In later Oberon extensions such as BlueBottle and A2 the
problem with forward references has been solved by
substantially rewriting the parser but I don't know the details of the
approach chosen. Having methods nested within a RECORD scope
was thereby less of a burden in practice and very natural with
respect to scoping.
In general, the message records and explicit message dispatching
as used in the Oberon system proved to be successful and have also
been used in BlackBox for the visible objects (Views), although BlackBox
does not use handler procedure variables per object but type bound handlers.
Class based OOP with method tables instead of message records is more
efficient because it replaces the message dispatching consisting of
cascades
of nested IFs by a tiny constant time operation. It gives up the
full flexibility and extensibility, though.
This OOP style has been used in the "Draw" editor for abstracting from the
different classes of graphical objects (Rectangles, Curves, etc.). The Draw
editor was used for drawing board layouts with hundreds or thousands of
graphical elements and at least at that time the performance gain
was important.
- Josef
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.inf.ethz.ch/pipermail/oberon/attachments/20170104/c70ca309/attachment.html>
More information about the Oberon
mailing list