4. Designing and Writing OpenROAD Server Applications : COM Data Types and Data Mappings : Data Mappings : Structured Type Mappings
 
Share this page                  
Structured Type Mappings
The OpenROAD Server supports structured data in the form of an OpenROAD user class or user class array.
A single user class instance can be thought of as a two-dimensional array with exactly one row, and with columns corresponding to the attributes of the user class. An array of user class instances can be thought of as a two-dimensional array with zero or more rows, each with columns corresponding to the attributes of the user class. Any attribute of a user class can itself contain a user class instance or array of user class instances, and this nesting can continue to any number of levels. Such nested structures are represented in the COM automation types as nested two-dimensional arrays of VARIANTs.
At the topmost level, the data to be mapped to the parameters of the 4GL procedure is packaged into a two-dimensional array with one row. The correspondence between the columns of this data array and the named parameters of the 4GL procedure is defined by a parallel descriptor array. The parameter descriptor array structure is generated automatically by the PDO and the OpenROAD 4GL RemoteServer system class, so clients never need to deal with it directly.
Note:  It is not necessary to map to all the parameters of the procedure. Only those contained in the descriptor/data array pair are mapped. All others receive default values. The same is true at all nested levels. Only those user class attribute names listed in the nested descriptor are mapped. All others receive their default values. Similarly, when data is returned through ByRef, only those parameters and attributes listed in the descriptor are marshaled back.