Geir Fjærli omnis at
Thu Apr 16 06:45:30 EDT 2009

Wanting to be able to modify a method in a subclass isn't wrong. In fact
that is how the original OO languages (like Simula) worked, therefore called
Scandinavian semantics. For most later languages - including Smalltalk and
C++ - it was considered more confusing than helpful, and so went out of
fashion. What would you want to happen if say you override two lines of code
in the subclass and change them, and maybe delete two others, and then later
in the superclass you change the method and delete a block of method lines
including the ones you overrode, and add some lines that depend on the lines
you deleted in the subclass?

While you cannot override the properties of inherited components on windows
(this is something I have wished for), you can add code to do so at runtime.
So any component that is mostly the same in all windows you can add to the
superclass, and then in $construct of the subclass change or hide it. Or you
can add a level of inheritance: Make a superclass that does not have the
button, and then a subclass that does, and then you final subclasses can
inherit from either of them.

As for documentation, these are the kind of things we discuss at my "Object
Oriented Omnis" session at the EurOmnis conferences, which I may be doing
again this year.

Geir :)

-----Original Message-----
From: omnisdev-en-bounces at
[mailto:omnisdev-en-bounces at] On Behalf Of Franco
Sent: 16. april 2009 12:09
To: 'OmnisDev List - English'
Subject: O$: inheritance

I never used superclasses and subclasses until yesterday. Then, building a
little library, I decided to try out this "strange" OO way.
The library deals with a rugby tournament with several teams, distributed in
4 age categories.
After some hours of coding the windows instances (inherited from a
superclass) were done good but I have a wish:

It would be very nice to have the ability to override a single line of code
of the superclass.
So in the subclass all lines of methods should be displayed blue (and the
whole code being visible, not only a poor "Inherited from SuperClass")
Furthermore I wish to override an object in a window. If I have a single
exception (such a button) I have to remove it from the superclass and add it
in every subclass, since it is not possible to change any property, like
forecolor, text etc..

But for sure I have not understood inheritance yet..
Maybe my wishes belong to a "not OO" vision of the inheritance
Where could I find some exhaustive documentation about?

Many TIA

More information about the omnisdev-en mailing list