Integrate business logic into ProDataSets using events
- Last Updated: March 30, 2020
- 1 minute read
- OpenEdge
- Version 12.2
- Documentation
One of the most basic advantages of OpenEdge as a development environment is the tight integration between the data access layer of an application and the business logic that operates on that data. This is something that set-oriented data access languages like SQL, combined with programming languages that were generally not designed specifically for data navigation, have never been able to match.
The ProDataSet extends this integration by allowing developers
to associate business logic procedures with ProDataSets, to be executed
when specific events occur, such as beginning a ProDataSet FILL operation, loading
a record into one of its member buffers, making a change to a row,
and so forth. This event logic can be written in separate procedures
from the procedure where the ProDataSet is defined and used, so
that it can be coded independent of the ProDataSet and attached
to the ProDataSet in any procedure where it is used. Generally speaking,
these event procedures receive the ProDataSet as an INPUT parameter
so that they can examine and modify any records in the ProDataSet,
depending on the nature of the logic and the event. This provides
developers with a standard way to associate business logic with
a ProDataSet to extend or replace the default behavior the ProDataSet provides,
or to provide behavior where no default support is possible. This
logic is executed consistently wherever the ProDataSet is used so
that the developer can write business logic in one place and know
that it will be applied uniformly.