Saturday, March 29, 2008

RMI

One thing that always happens in retrospect is that I find Norm is right. He always said that language is key and that we needed an interpreter. OK, it isn't the whole answer, but now I see the truth in what he was talking about... more than 6 years later.

I spent the afternoon avoiding the code. Imports and exports are done and I didn't want to tackle the server-side interpreter until I felt good and ready. Finally I dug into the code and learned that this is going to be a very simple change indeed.

There are only 2 small changes needed to get started. First in Browse, if a command is not recognized we execute a transaction with an action that has a CommandLine attribute in place of the OpCode attribute. Easy.

The second small change is in the ActionExec.execute method. There we check and if we have a CommandLine attribute, we call a new rmi method to parse the command line and create the appropriate attributes. And that's it!

Now there is one assumption here--that there is a one-to-one mapping from commands to operations. This looks reasonable.

The next step then will be to augment browse with a "run fileName" command. This command will read a file and create an action for each command in the file, and then submit the whole thing to run as a single transaction. This then will give us an appropriate means of configuring branches and solve the existing problems with backward compatibility.

Piece of cake!

0 Comments:

Post a Comment

<< Home