[M3devel] small design problem in ButtonVBT?

Olaf Wagner wagner at elegosoft.com
Wed Apr 1 12:03:47 CEST 2009


Quoting hendrik at topoi.pooq.com:

> The BottonVBT contains an action, which is a procedure rather than a
> method. b This makes it awkward to subclass ButtonVBT becaue the action
> will still expect its first parameter to be a ButtonVBT instead of
> belonging to the subclass, and an explicit downcast of some sort will be
> needed to acess the subclass's members.
>
> The Trestle manual says this was a deliberate decision:
>
> : The action procedure is a field rather than a method in order to allow
> : buttons with different action procedures to share their method suites.
>
> I, however, find it massively inconvenient because it mans I have to
> resort to downcasting or the very kludgey VBT.GetProp to access what
> should be just there.  I'd rather the action procedure was a method.
>
> But it should be possible to have the best of both worlds.  Have an
> action2 (better name wanted here) method that is available for
> overriding, and by default calls the procedure in the existing action.
> field.  That action2 method wounl then be called by Trestle wherever
> action is now called.
>
> Does anyone see problems with this?

Sounds fine to me offhand. You should test your extensions with
some of the existing larger applications, like mentor and Juno-2,
of course.

Olaf
-- 
Olaf Wagner -- elego Software Solutions GmbH
                Gustav-Meyer-Allee 25 / Gebäude 12, 13355 Berlin, Germany
phone: +49 30 23 45 86 96  mobile: +49 177 2345 869  fax: +49 30 23 45 86 95
    http://www.elegosoft.com | Geschäftsführer: Olaf Wagner | Sitz: Berlin
Handelregister: Amtsgericht Charlottenburg HRB 77719 | USt-IdNr: DE163214194




More information about the M3devel mailing list