Hi!

In my Jacl application, users may write Tcl scripts to manipulate database objects:

prompt% set o [createRect 0 0 20 30]
java0xcf
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:
prompt% set o [createRect 0 0 20 30]
rect0x01
Where the Java code would be something like:
tclObject = ReflectObject.newInstance( interp,
         obj.getClass(), obj );
tclObject.setRefID( "rect" + getNextCounter() );
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?

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
 

Reply via email to