In the best of all worlds I’d be able to mix ruby and runrev’s
“transcript” code in an application. Simple, and I’d have lots of
power. I’d need the source code to the runrev environment though to
do this, which I don’t have access to. Second best would be to make
calls to a local or remote ruby installation. This is a bit awkward,
though, because you can’t deal with ruby objects in the home
language, just text results from ruby. I guess that if you’re going
to maintain some state on the Ruby side (rather than just use it to
return stateless remote method calls) then you’d need to be able to
marshal objects. I gather that YAML would be the preferred choice here.
dRb looks nice, but it’s not made for cross-language communication,
right? So, we’re back to some kind of remote method calls, either by
calling ruby scripts through a socket or through a SOAP setup and
then maintaining state with some YAML marshalling. But if I’m going
to go through all of this it almost seems like I should just set up a
centralized RonR installation and then I’d get everything for free–
apps that can maintain state, marshalled objects, active record, etc.
On this plan I’d be implementing java client-style app’s with runrev
- ruby. But where java client apps can distribute objects as needed
to either the client or the server, my client apps would be “thin” in
that all the objects would be remote (because there’s no ruby at all
on the client side). If I were to pursue this “thin client” model
with RonR then I guess I’d be using http, but there would be 2 hurdles:
1- Figuring out what to return from RonR and how to return it-- XML
files? raw text files? etc.
2- Manually handling the cookies so that I could maintain sessions,
and thereby states.
One advantage of doing this would be that I’d already have a lot of
the architecture in place when I start moving over some of our web
apps to RonR . . .
Anyway, does this reasoning seem sound? Is there a better way of
doing this? I’d be happy to do something simple where I set up a
socket to a script that simply returns text results of ruby calls
but I don’t know how I’d maintain knowledge of the active record
models on the ruby side.