Comparison with procedure-based programming delegation
- Last Updated: February 28, 2019
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
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.