In-Touch Makedata

Posted by mop Thu, 08 Jul 2004 03:01:00 GMT

Not sure where I’d like this type of documentation to exist, but it should be preserved for posterity. So... here’s some background on In-Touch’s object-relational framework: Makedata.

Makedata is a Java app that creates *.java files that encapsulate the RDBMS <--> Java mapping. Each object/table is defined in a simple text file () which Makedata transforms into three files:

table.sql
a SQL script that creates the table and indices
tableRawData.java
a java object representing the raw data (members plus accessor methods, very bean-like)
tableRawRowBuffer.java
a java object that knows how to read and write the raw data to/from the database

The generated classes are generally found in the ./target/generated-datafiles/ directory. The Ant task ’datac’ invokes makedata.

Each *RawData class is a sub-class of intouch.data.Data. Each *RawRowBuffer class is a sub-class of intouch.sql.RowBuffer. Generally we extend each of the generated classes and these sub-classes of *RawData and *RawRowBuffer become containers for business logic.

Another important class is intouch.data.View which defines a bit-field representing each fields in a data object. A view of the table/data is defined by turning bits on and off.

We also use these classes to represent table joins. There are two abstract classes intouch.data.ViewData and intouch.data.ViewDataRowBuffer which are extended to define joins. Again, for each object-rdbms map there are two classes, one for data and one for db read/write.

Posted in ,  | no comments | no trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
/articles/trackback/121

Comments are disabled