From: Jonathan C. <cra...@pc...> - 2003-03-11 06:56:16
|
I've committed several files pertaining to the Java object layer; they are all in GUS/ObjRelJ/src/java/org/gusdb/objrelj/. Be warned that this code definitely does *not* compile (and we've modified the build system so that by default it should not try to compile the Java code). However, you can take a look at some of these classes to get some idea where we are headed (see below for some suggestions on where to start with this.) First, a little history; work on the GUS Java object layer was originally started by Sharon Diskin, who had quite a bit of experience with the Perl object layer. As much as possible the Java version of the object layer tries to duplicate the functionality and semantics of the Perl object layer, although we have had to diverge somewhat from that goal in order to allow the Java object layer to be used over RMI. In any case, most of the work on this code has been done by Dave Barkan, who took over when Sharon left to become a full-time Ph.D. student. I've been overseeing the work that Dave has done and, not satisfied that the code was enough of a mess, took it over last week to update the documentation, refactor some of the classes, and make a number of other changes. Needless to say, I am still working on all of this, which is why nothing compiles right now. However, the refactoring and several of the other recent changes are absolutely necessary for the object layer to work correctly, and I don't think it will take too much longer to get everything working again, now that I've finally figured out how the different interfaces should interact (I think.) If you get a chance to look at any of this code before the conference call tomorrow, here's what I'd recommend focusing on: ServerI.java This interface defines the API to the object layer. It allows an application to retrieve "GUSRow" objects from the database, modify them, and then write them back. (Or create entirely new objects and insert them, etc.) GUSRow.java Superclass for all GUS objects. So far each instance of GUSRow should correspond to at most 1 row in a GUS database. GUSTable.java, GUSTableRelation.java, GUSTableAttribute.java Classes used to represent database metadata (i.e., the schema of the various tables.) DatabaseConnectionI.java, RemoteDatabaseConnectionI.java These interfaces describe the same low-level database API, but one is Remote and the other is not, allowing the object layer to be used over RMI if so desired. Note that GUSRow is an abstract class (and GUSTable probably should be too). Subclasses of these classes are generated by a code generator much like the Perl code generator. The Perl and Java code generators are both implemented in Perl and depend on the Perl object layer, and so they reside in GUS/ObjRelP. This will probably make more sense once I get everything working again and can actually show a sample application. The main thing I'm still working on is the refactoring of the code to allow the object layer to be used over RMI. The complication basically results from the fact that the GUSRow objects are passed by value over RMI, not by reference. This means that we can't do anything by side-effect over RMI. However, being able to modify the GUSRow objects by side-effect is a very convenient way of passing information from the object layer back to the application. So what I'm doing is refactoring the classes to properly distinguish the methods that are allowed to use side effects from those that are not. The ones that are not can be accessed over RMI. Let me know if you have any questions; I'll probably be working on this again tomorrow morning. Jonathan |