Try OpenEdge Now
skip to main content
Object-oriented Programming
Object-oriented Programming and ABL : Overview of object-oriented programming : Delegation : Comparison with procedure-based programming
 
Comparison with procedure-based programming
Much of this description is very similar to how procedures interact. When a procedure named A.p runs an internal procedure in a procedure handle for B.p, it is effectively delegating the behavior of the internal procedure to B.p. In this situation, A.p is similar to the container class in the object-oriented model, and B.p to the delegate. And clearly, a third procedure named C.p cannot invoke the delegate's internal procedure directly through A.p, unless A.p itself has an internal procedure or function definition that runs the effective behavior in the handle to B.p. The key distinction with classes is that the compiler verifies all of the references between classes, whether they are within the same class hierarchy or not. Thus, ABL has a much more detailed and complete definition of everything that is controlled by a container class than it can have for a procedure that runs behavior defined in another procedure.