Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of object-oriented programming : Strong typing : Comparison with procedure-based programming
Comparison with procedure-based programming
Strong typing is one of the key differences between procedure-based and class-based programming. When one ABL procedure runs another, ABL is generally unable to tell at compile time whether the RUN statement is valid or not. Even when you run an internal procedure in the same procedure, ABL does not verify that the internal procedure exists or that its signature matches. If you run another external procedure, or an internal procedure that is contained in another external procedure, the compiler has no way of checking whether the RUN statement is valid because the compiler never examines one procedure while it is compiling another.
When you use classes, because of strong typing, the compiler always verifies the correctness of every statement that references another class, and might even compile the other class to do this, depending on the relationship between the classes. This compile-time validation across classes is one of the most fundamental benefits of using classes. Procedure-based programming gives you greater flexibility in how the pieces of your application fit together, even allowing you to specify the name of a procedure as a variable or expression. But this flexibility comes at the cost of much less confidence at compile time that all the elements of your application will operate and interact correctly when you run it. Thus, class-based programming provides the opportunity to move much more of the verification of an application's correctness from the burden of run-time testing into the compiler.