Class Methods Vs. Procedure variables in Records
When Object Oberon was released in 1989, this was in fact done. Appendix 3 of the Object Oberon report dated June 1989 contains a description of a basic class library written in OOP style, which essentially corresponds to the Original Oberon viewer system. For example, there is a core module “Frames" exporting a class “Frame", which in turn defines a set of methods such as Show, Hide, Resize, Move, Copy, Defocus, Neutralize etc. And there is also a module “TFrames” (in analogy to module TextFrames of Original Oberon) exporting a (sub) class “Frame", which defines methods that override some of the basic methods from the base module “Frames”. But I don’t know how much it was used, and what the experiences were. I haven’t used it myself. —Andreas -------------------------------------------------------------------------- From: Richard Hable informujo at aon.at Sun Mar 5 22:56:49 CET 2017 Am 2017-03-03 um 11:40 schrieb Andreas Pirklbauer:
That is exactly right: There are indeed no type extensions in the Oberon "inner core" (modules Kernel, FileDir, Files and Modules). And almost no type extensions in the "outer core" (modules Input, Display, Viewers, Fonts, Texts, Oberon). The one exception I found is in module Texts
I think, it would actually be a good thing to have more object orientation also in the core modules. It could make the system less static and more adaptable and user friendly. For example, if module TextFrames contained type-bound procedures based on the Frame type instead of a collection of static procedures with a Frame parameter, one could easily adapt its behavior by overriding just a few selected procedures. And if all documents were based on a common type with overridable type-bound command procedures, the user would not have to choose between commands like "Edit.Store" and "Draw.Store", but simply invoke "Store", which would automatically call the right procedure according to the actual document type. Richard
Srinivas Nayak sinu.nayak2001 at gmail.com Tue Mar 7 08:12:47 CET 2017
It seems good, to have one Store command. But shall we unify everything on a GUI machinery? Shall we imagine only one Save button on a Windows desktop, which will save any kind of file opened on any application, finding the actual application object from the active window?
It’s probably possible to create a single command for *some* operations that are shared among various tool modules, and use OOP style to implement them. For example, the 3 modules Edit, Draw and System all export the commands Open and Store, the 2 modules Edit and System both have a command Recall, the 2 modules Edit and Draw both export commands ChangeFont, ChangeColor, etc. Such commands could be placed in one module, e.g. module System, and be programmed such that they simple dispatch control one level down to the appropriate handler. But apart from these common commands there will, in general, always be additional commands specific to the particular tool module such as Edit or Draw. For example, the commands Search and Locate only exist in module Edit, and the commands Macro or Restore exist only in module Draw, etc. And for these, one would still need separate modules exporting them. I suppose it can be done. I don’t know what ETH’s position would be on that if the discussion were held today.
participants (1)
-
Andreas Pirklbauer