How it Stacks

  Previous topic Next topic  

The Architecture

C bindings and Caché ObjectScript has been exploited to develop CachéRDD. The architecture is best depicted via the following diagram:

Application

Application
Layer

(x)Harbour Executable
linked with
CachéRDD.lib

C Bindings

Communication
Layer

cbind.lib ( extracted from cbind.dll )
cbind.dll
CachéODBC.dll
cppbind_msvc80.dll

CachéRDD

Database
Layer

A Database CACHERDD - holds ObjectScript code
A NameSpace CACHERDD having CACHERDD its default database
CACHERDD database will have supplied Caché.dat
Another NameSpace having any database as its default
to hold all the application data.

No other requirement at the server side for the running of (x)Harbour application.

Caché.dat, the supplied database holds object code of one "ObjectScript Class" and one "Routine". No other data is stored in CACHERDD namespace.

 

XBASE vs SQL

The fundamental difference between XBASE and SQL dialects is that XBASE is processing data on ROW-by-ROW whereas SQL on ROW-SET. So XBASE cannot take advantage of SQL oriented approach. In RDBMS context RDD approach referes to ISAM, Indexed Sequential Access Method ( http://en.wikipedia.org/wiki/ISAM ). Today no RDBMS provides interface to access tables in this way except for Caché. This great feature of Caché has become the foundation for CachéRDD.

 

Inside CachéRDD - Strengths and Weaknesses

CachéRDD receives the RDD client request and executes a corresponding method. The method parses the supplied parameters, converts to appropriate Caché equivalent, executes a series of ObjectScript functions, and return desired info the calling process is waiting for. CachéRDD takes use of public variables visible to every class method which hold the information about RDD work areas, table structures, index definitions, index informations, and pointer to last executed operation. These variables are set when a table is opened and cleared when closed. The concept of public variables in Caché is like what xHarbour implements.

Strengths

One of the strongest feature in Caché which I loved most is the concept of sparsed arrays. xHarbour also has the similar concept so I used this technique fully. No need to pre-define an array, wonderful! Caché provides library functions too to manipulate those arrays in any way.
The other strongest feature of Caché is the ability to create/edit classes programatically. Had this feature been not there it would had been impossible even to imagine the concept of CachéRDD. Simply SUPERB. This feature is employed mainly in managing tables and indexes, the backbone of any RDD system.
And yet another awsome feature - access to any global directly - with $Order() and $Query(). Wonderful. Perhaps no other RDBMS in market today provides such construct. This feature become the backbone for table navigation  in CachéRDD, the integral part of any ISAM based system.

Weaknesses

I wished that Caché should have had a few more functions in ObjectScript in line with SQL engine. However, I was able to overcome this deficiency by developing my own routines.
I also struggled with the conditional indexes, the feature once present has been deprecated by InterSystems. However, because of open architecture of ObjectScript I succeeded in simulating this behavior 100% in accordance with native RDDs of (x)Harbour. What I have not been able to simulate so far is creating a temporary index on the fly and abandoning it when not needed.