Comparison with procedure-based programming main blocks of persistent procedures
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
Comparison with procedure-based programming main blocks of persistent procedures
An instance constructor for a class is similar to the
main block of a persistent procedure. Parameters passed to a class's
constructor are similar to parameters passed to a persistent procedure
when it is run. When you instantiate a class using the NEW function,
the specified constructor executes as part of the class constructor
hierarchy and returns to the caller with the object reference to
the instantiated class. The caller can then use this object reference
to access public data members and properties and to call public
methods on this class-based object. When a procedure is first run PERSISTENT,
the code in its main block executes and returns to the caller, setting
the procedure object handle. The caller can then access any variables
that it shares globally with the procedure object and can use the
procedure object handle to run internal procedures and user-defined
functions in the procedure object.