next up previous contents
Next: Data Server Optimizations Up: Construction of the Data Previous: Building the DAS and   Contents

Building the Data Read Program

While the two programs used to send the DAS and DDS to the client both may read from the data set, the send data program necessarily must read from the data set. This program reads the values of a single variable in the data set (as defined by the Data Access Protocol) and packages it in a Multipurpose Internet Mail Extensions document. This MIME document is then sent to the client process. The client process must decode the binary MIME document and internalize the data it contains (see Section [*]).

A structure chart for the send data program is shown in Figure [*]. This structure chart shares some features with the DAS chart in Figure [*]; it also has modules for CGI parameter parsing and construction of a MIME document. However, there are some important differences between the two figures. The MIME document sent to the client by the send data program contains both text and binary parts, while the DAS and DDS programs send text-onlyq MIME documents. In addition, the send data program uses the DDS object (which contains instances of objects for each variable in the data set) when it performs the read operation.

The implicit dependency between the DDS filter and data filter programs is important. In order for the send data program to function, it must invoke the read member function for the requested variable. However, to get the variable object, the send data program must have access to the DDS object. Thus, before send data can do anything beyond parsing its arguments, it must build the DDS object. This may be accomplished in several ways: the DDS object may be cached (either as binary data or using the text representation built for transmission to the client), it may be built explicitly by the send data program via the DDS program (the send data program acts as a client of the DDS send server program), or it may be built by including the DDS send program's logic in the send data program.

Once the DDS object has been instantiated by the send data program, it must invoke a member function to read the desired variable from the data set. The read member function for each class of variable described in the data access protocol must be specialized for any API used to read the data set. The specialization of the data type hierarchy for a particular API is described in the documentation for the client and server toolkit.

Once the data for the variable has been read into the correct object within the DDS, the data filter must build a multipart MIME document so that the data can be returned to client program. This MIME document contains a text part and a binary part. The text part consists of a DDS which describes just the variable in this document (as opposed to every variable in the entire dataset) This is straightforward to make given the completet DDS and the client and server toolkit software. Following the text section, the data filter program must append the value of the variable (encoded using XDR).

Figure: Structure Chart for the Data set Variable Read Server Program.
\begin{figure}\centerline{\psfig{figure=server-send.ps}}\end{figure}


next up previous contents
Next: Data Server Optimizations Up: Construction of the Data Previous: Building the DAS and   Contents
James Gallagher 2004-04-21