Try OpenEdge Now
skip to main content
Object-oriented Programming
Designing Objects: Inheritance, Polymorphism, and Delegation : Using delegation with classes : Comparison with procedure-based programming
 

Comparison with procedure-based programming

The use of containers and delegates in classes is very different from procedures, where a RUN statement for another external or internal procedure cannot be checked until run time. The unanticipated run-time error that occurs when one procedure mistakenly runs another becomes instead a compile-time error when you use classes, which can be corrected before the application is ever executed. Thus, when using procedures to implement delegation, note that:
*The design and functionality is not very different from using classes. The difference is in the level of compile-time checking.
*A procedure container can use class instances as delegates.