define class x as &yYes, but also in the case of
ox = CreateMyObjectViaTableBasedFactory("myClassHint", "myUnclearpathtotheVCX") ox.draw()It is difficult to be certain on which class inheritance level the draw method has to be implemented at least once.
* Abstract method must be overridden
Why not use the commentary fields for that ? They can be accessed programatically as well AND the developer sees the hint even when working on siblings of the base class. Just make your own rule, that the first line is for automatic parsing as well...activate window "debug output" ox = createobject( "g2" ) ox.Draw() && no dodefault, so no chance of assert oy = createobject( "g2a" ) oy.Draw() && assert suppressed because called by implemented method, && but has dodefault and the better way of coding can be used o3x = createobject( "g3b" ) *-- should trigger, as no implementation method exists o3x.Draw() && assert not triggered ? triggers in germany when run as a prg... op = createobject( "gpolymorph" ) * Here is also no Implementation method, but the assert is not * triggered because the call stems from a polymorph method. * At the moment I can think only of ugly / slow ways to force an assert * here as well op.draw() *-- just make sure the asserts are still working... o3x.draw() return function AbstractWarn() local lcSetAssert, lcAbsCaller lcAbsCaller = Program(program(-1)-1) if not JustExt(m.lcAbsCaller)==JustExt(Program(program(-1)-2)) lcSetAssert = set("Assert") set Assert on assert .f. Message m.lcAbsCaller + " should be overwritten !" set Assert &lcSetAssert endif define class GraphicAbstractObject as custom x = 0 y = 0 function moveTo( newX, newY ) = AbstractWarn() endfunc function draw() = AbstractWarn() endfunc enddefine define class G1 as GraphicAbstractObject function draw() debugout 'level G1' return enddefine define class G2 as G1 function draw() dodefault() debugout 'level G2' return enddefine define class G1a as GraphicAbstractObject enddefine define class G2a as G1a function draw() dodefault() debugout 'level G2' return ENDDEFINE define class G1b as GraphicAbstractObject enddefine define class G2b as G1b enddefine define class G3b as G2b enddefine define class gpolymorph as Custom function draw() *-- calling from here (existance of the callee assumed) *-- breaks the assert check, since the polymorphic method does not *-- implement a method of the abstract class. o3x.draw() enddefine