MichaelB.
7/28/2018 - 10:30 AM

Redefine a method (REDEFINITION)

Redefinition is the ability to change the implementation of a subclass instance method. The interface MUST remain the same - the visibility and parameters always remain unchanged. The REDEFINITION statement hides the Superclass method to ensure only our subclass redefined method is executed at runtime by our object. Applies to the subclass and any subclass which inherit from that subclass. REDEFINITION reimplements the method in the implementation part of the subclass. You can still call and execute the SUPERCLASS method and pseudo-reference it if you need to. Can be useful if you first want to execute the functionality of the superclass and extend it with the functionality you have redefined in your subclass. You must specify the method again with the method statement in the same visibility section as was defined by the superclass in the declaration part of the subclass. Then write the code in the implementation section as you normally would (using the same parameters if applicable).

METHODS mymethod REDEFINITION

*Call the SUPERCLASS Method - Pseudo-Reference
CALL METHOD super-mymethod