Sample Methods of an Application Class Resolving Terms
The following code is an example of an application class that has several methods for resolving terms.
class OperatorInfo
method Get_Person_Name();
method Get_Person_Salutation();
method Get_Person_Title();
method Get_Person_Gender();
method Get_Person_BirthDate();
method OperatorInfo(&_oAccessMethodParam As EOCF_CLF_DL:Runtime:
AccessMethods: AccessMethod);
private
instance EOCF_CLF_DL:Runtime:AccessMethods:AccessMethod &ioAccessMethod;
end-class;If the data library engine invokes an application class method, that method is responsible for deriving the results and for inserting the results in the AccessMethod object. The data library engine transmits the results to the calling application. If an application class method is not specified in the implementation definition, the constructor is responsible for performing these tasks.
The data library provides several mechanisms through which the application class can return the output value to the data library:
-
The application class instantiates one of the following application classes with the output value that needs to be passed to the engine.
-
ResultsRecord Record &oResultsRecord = create EOCF_CLF_DL:Runtime: Results:ResultsRecord(RecordVariable); -
ResultsRowset Rowset &oResultsRowset = create EOCF_CLF_DL:Runtime: Results:ResultsRowset(RowsetVariable); -
ResultsScalar Scalar &oResultsScalar = create EOCF_CLF_DL:Runtime: Results:ResultsScalar(ScalarVariable); -
ResultsVector Vector &oResultsVector = create EOCF_CLF_DL:Runtime: Results:ResultsVector(VectorVariable);
-
-
The type of class to be instantiated depends upon the type of data that needs to be returned.
-
The instantiated object is assigned to the member of AccessMethod object.
Note:
Application class objects are not cached. When the data library engine invokes the application class because the data is not available in the cache, the application class is instantiated by invoking the constructor, then the method specified in the implementation. Therefore, the instance variables created in the constructor cannot be shared across multiple methods of the same class to resolve different terms.