Data Model > Extending the UNICOM Intelligence Data Model > Creating a CDSC > Structure of the CDSC interface
 
Structure of the CDSC interface
To transfer data from the data source to the Provider, a CDSC must have the following class hierarchy:
The ISource class has three branches:
The first branch manages information about the columns and the tables through the Table and Column objects.
The second branch is concerned with access, storage, addition, and modification of the actual data. The Command object is used to manage a command session, which binds data (using the DataBinding object) to the variable's value and type as managed by the Value and ValueAttributes objects.
The properties collection in the third branch is used to communicate to the Provider the features supported by the CDSC.
For a full description of these classes, see CDSC Interface in the Reference section of the UNICOM Intelligence Developer Documentation Library.
For all CDSCs, the first point of contact for Provider modules is the Source interface. The Provider creates an instance of your Source object, optionally sets some connection properties on it, and then calls its Initialize method to establish a connection to the data source it wants to access through the CDSC. The properties that can be set include a description of the features implemented by the CDSC and information about the data source and the length of time before being timed out.
The transfer of the hierarchical structure from the data source to the Provider is achieved by the Provider calling the Source object's Tables property. This property returns the root Table object, which contains a collection of child columns, and if HDATA is supported, a collection of child table objects, which in turn can contain their own columns and child tables. The recursive nature of the hierarchical data means that all of the tables can be accessed through the root table.
Once the Provider is aware of the data structure, it can retrieve the data from any columns and tables through a command session. A command session, which is a series of data bindings between the variables and the columns, allows operations to be performed on the data. The Provider indicates to the CDSC which columns and tables it requires by setting data bindings for the columns and tables of interest. After the command has been created and the data bindings have been set, the Provider can call MoveFirst on the Command object. This subroutine sets the value property in the DataBinding object to the first value for all of the columns of interest. If the columns or tables are at a level below the root level, the command object creates new commands to deal with these. The Provider can then repeatedly call the MoveNext subroutine of the Command object to update the value properties in the data binding for the next row in the table until the entire table has been traversed. The Command object has additional functionality to cope with HDATA and updating and deleting row set values.
See also
How should a CDSC return categorical data?
CDSCs and variables
Custom connection properties
Testing your CDSC
Activation diagram for SELECT statement
CDSC interface
Creating a CDSC