Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Programming models in ABL : Comparing programming models

Comparing programming models

In general, the run-time nature of procedure-based programming can support a more dynamic coding model than you might write in order to accomplish the same task using class-based programming. Class-based programming, on the other hand, can support a simplified program structure that is much easier to maintain and that helps to identify and more easily reuse code from one object to another. However, because you can almost freely mix class-based and procedure objects in the same application, you can choose the implementation model that best meets your requirements for any given programming task.
Many successful applications have been built, and will continue to be built, with procedures, including the addition of object-based extensions using persistent procedures and the super procedure mechanism to create a run-time inheritance chain. Generally, Progress Software Corporation recommends that you consider using classes for new development. They provide much greater assurance that ABL code that compiles will also execute successfully, whereas many code paths that lead through a set of related procedure instances can be verified only by testing them at run time.
There are certainly circumstances, however, where the use of procedures might well be preferred. Precisely because procedures give you the flexibility to assemble a procedure hierarchy at run time, super procedures allow you to combine procedures in a way that is data-driven or determined by application logic at run time. Likewise, the dynamic RUN VALUE(procedure-variable) statement and the DYNAMIC-FUNCTION built-in function let your application invoke procedures and functions whose names are determined at run time, which can also support data-driven operations.
Throughout this manual, there are frequent comparisons between class-based programming and procedure-based programming. To simplify the documentation, the term class-based refers to objects and programming that is based on ABL classes, and the term procedure-based refers to objects and programming that is based on ABL procedures. Also, this manual contains a number of sections and subsections with the common title, "Comparison with procedure-based programming." These sections and subsections appear where use of a specific class-based programming feature is compared with the use of procedure-based programming that provides the same or similar functionality.