SITH: Compiling
Warning
Java2 has bugs. When ia function is open in an object window (described in Sith Compiling ), moving from one tab to the next will confuse the TextArea and not allow you to edit the source code. To fix this, click on the ERRORS HERE TextBox. Java 1.1 does not have this problem. I guess Sun does not like to distribute working code.
Introduction
The DBC is able to compile the functions into Java class files. The compiler is hard coded; it does not exist inside of the DBOS yet. SITH has an interface to the compiler. Every function in DBC has an entry in the Function Type table. SITH picks up on that an displays a special record editor.
Inspecting an Existing Function
Let us look at an existing function. First, goto the Class Table window: I have filtered the table so I can see the Object Class:
Right click on the row button for Object Class and select "Change".
You can see that I went to the Class Class tab, and I highlighted the attribute (function) we are going to inspect. Right click on the row button for the "print" attribute and select "Change":
The print attribute has instances of many classes. The one we are interested in is the Function Type tab. We can see that this is not a regular record editor tab, it lacks the tables most other tabs have. A textarea exists at the top, it contains the Object Code of the function. Below it is a textbox for compiler messages, and below that are two of the Funtion Type attributes.
- Every function must have a Return Type. It is invalid for a function to not have a return type. This may be fixed in the future.
- The Parameter Type indicates the type of message that this function will handle. We see that it handles the Print message.
The print function is a simple. The first line prints the three dashes (---), then it iterates over all variables in the object. It prints the field name, then it determines of the variable is an instance of String Class, if it is then it is printed directly, otherwise we print the name of the object that the variable points to. Finally we print a new line character.
Compiling
At any time, we can try and compile the function with the Compile button. Each time the compile is done a new version is generated, and replaces the old version. There is no need to restart SITH to run the function, all future message handling will use the newest version. (remember to save the database file to keep the new version between sessions). The compiler also converts the Object Code to a semi-tokenized form. This form is name-independent. Therefore if there are any object name changes, the souce code will reflect that.
The Save button saves the source code as is, and acts as an alternative to the Compile button The Save button is usually used for partially complete functions that can not compile yet, so it does not have the advantages of name independence. The menu option Record -> Save saves the function as a whole, but does not save the source code, or compile. These two methods of saving are perpendicular: both must be used to save the whole function.
Conclusion
The compilation window is the only IDE that the DBCruiser has at the moment. With the advent of this programming environment, the development of the DBCruiser should soon have an Object Coded IDE that closely resembles the comercial IDEs of today.
August 29th 2000 - The old version had references to non-lined queries. Now the docs reflect inline queries.
June 2000 - Initial version.