Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of class-based ABL : Creating and destroying a class instance : Comparison with procedure-based programming
 
Comparison with procedure-based programming
Using the NEW statement to instantiate a class and assign its object reference is roughly equivalent to running a persistent procedure and setting its procedure object handle using the RUN statement. Just as a procedure-based ABL application that instantiates persistent procedures must begin with a startup procedure file that directly or indirectly creates procedure objects through other procedure files, a class-based ABL application must also begin with a startup procedure file that directly or indirectly creates class-based objects. (You cannot directly startup an application with ABL using a class file as you can, for example, with Java.) When it is no longer needed, you can use the DELETE OBJECT statement to destroy a persistent procedure. Class instances are automatically deleted (garbage collected) when a reference to the object no longer exists in the ABL session.