Guideline 4: Avoid defining object properties and events in super procedures
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
This guideline is related to the previous ones about always referring back to
TARGET-PROCEDURE for any data needed for an operation done by a
super procedure. It also relates to keeping all super procedure data local to the
individual internal procedure or function. You should define a property or other
persistent data value in a super procedure only if it is truly global (that is,
to be shared by all object procedures that use that super procedure). This should be the
exception.
Similarly, it is a good rule that super procedures should not subscribe to or publish
named events directly. You learn about the ABL PUBLISH and
SUBSCRIBE syntax in the PUBLISH and SUBSCRIBE statements
section. A PUBLISH or SUBSCRIBE statement should
always be done on behalf of the object procedures they serve. Super procedure code might
need to subscribe object procedures to named events to set up relationships between
procedures.
Forgetting to carry out program actions relative to TARGET-PROCEDURE is
one of the most common mistakes in using super procedures.