Try OpenEdge Now
skip to main content
ProDataSets
Advanced Read Operations : ProDataSets as a data access layer : Sharing ProDataSet and temp-table definitions between procedures
 

Sharing ProDataSet and temp-table definitions between procedures

As we have shown in these examples, it is a good idea to put your definitions into include files so that they can be reused in as many procedures as need them and maintained by editing the one include file for a definition. It is also a good idea to separate your temp-table definitions from your ProDataSet definitions. This lets you reuse the temp-tables, for example, in multiple different ProDataSets, as the ttItem illustration above shows. It also lets you include ProDataSet definitions in places where the temp-tables need to be defined separately, such as in the AppBuilder.
In summary, there is no single right granularity or complexity for a business object or the ProDataSet that represents its data. Design your ProDataSets so that they represent useful collections of data, either single business documents or sets of data that are normally handled together. Remember as you do this that the AVM gives you a lot of flexibility in how you load and use the data in a single ProDataSet. As you have seen in earlier examples, an Order ProDataSet can contain a single Order with all its detail, or it can be used to browse Order headers and filling in the detail as you need it. Thus, you can make the scope of a business object larger or smaller, depending on your needs.