Try OpenEdge Now
skip to main content
ProDataSets
Data Access and Business Entity Objects : Business Entity object : Elements of a Business Entity
 

Elements of a Business Entity

In principle, a Business Entity as an object can map to an ABL procedure. This might in turn be supported by any number of other procedures that provide either specific validation logic for the entity or general support services used by all entities. Each Business Entity is normally paired with a Data Access object that manages the connection to the actual data sources. As discussed earlier, in many cases a single running instance of a Data Access object could provide data for any number of requests from different Business Entity instances.
In a distributed stateless environment, a server-side Business Entity will normally not live beyond a single request. It can fill its ProDataSet for a particular Order, for example, return that Order to the client, and then either terminate or remain in memory to be used by another independent request, depending on how the application manages its procedures. On the other hand, if one Business Entity is used by another Business Entity in the same session, as part of its validation logic, for example, then there could be a relationship between the two procedures that would last beyond a single request.
As with the Data Access object, the Business Entity will typically be a static object. That is, it will be based on one or more static ProDataSet definitions, and contain (directly or indirectly) mostly specific logic to support its use. This logic will include a specific API for the various kinds of requests that can be made of it, and validation logic to apply to update requests. A dynamic Business Entity designed to handle a certain class of similar data objects is also entirely possible, of course.
Given these basics, the following sections outline some of the common elements of the Business Entity.
* ProDataSet and temp-table definitions
* Relationship to the Data Access object
* Attaching the Data-Sources and callbacks
* Defining a data retrieval API
* Defining a generic update API
* Validation procedures for the generic update API
* Defining a custom update API
* Managing Business Entity instances