In my Jacl application, users may write Tcl scripts to manipulate database objects:
prompt% set o [createRect 0 0 20 30]However, if a script is to be written that is associated with a specific object, then that objects id (the java0xcf name) must be persistent and stored when the db is saved. What I envision working well is:
java0xcf
prompt% set o [createRect 0 0 20 30]Where the Java code would be something like:
rect0x01
tclObject = ReflectObject.newInstance( interp,Thus when the rectangle object is saved to the db, the reflect object name ("rect0x01") could be saved with it. Is there a way to do this?
obj.getClass(), obj );
tclObject.setRefID( "rect" + getNextCounter() );
By setting the ReflectObject's name, different objects could be swapped in and out for the same reflect name.
Any thoughts on how best to do this within the scope of Jacl? Of course I can always make my own mapping for my objects, but I'd like to first try to stay within Jacl.
Tom