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

Data Access object template

There is at this point no specific Data Access object template, that is, a single procedure that can support most Business Entities. A template can be in the form of a static skeleton procedure that is filled in by a tool or wizard (or just by editing it by hand). Or it can be in the form of a dynamic procedure that is able to analyze a ProDataSet through its handle and operate on it in a generalized way.
A dynamic support procedure would not be able to do very much in a generalized way for most ProDataSets. As you have seen from the simple examples in these chapters, both the queries that prepare the ProDataSet for a FILL and the logic of FILL event procedures themselves are likely to be very specific to the structure of the ProDataSet. Even an attachDataSet function needs to know what event handlers to attach and what the field mapping is for attaching Data-Sources.
It certainly is possible to define a static template procedure to be filled in by a design tool, or by a wizard, or by the simple act of editing a copy of the procedure and replacing instructional comments with specific code to support an entity. Defining a specific such procedure is beyond the scope of this chapter, and will be done in conjunction with defining tools for designing and building Business Entities. The topics in this chapter are intended to provide some general guidelines of things to think about as you design your objects.