Avi Bryant avi at beta4.com
Thu Feb 27 21:19:21 UTC 2003

I've been watching the work on SPrevayler with a cocked eyebrow, because I
have to admit that I find it an extremely clunky approach, at least in its
Java incarnation.  Stephen's suggestion to combine it with REPLServer is
interesting, but I think goes in the wrong direction - we don't want to be
logging doIts (isn't that what the .changes file does anyway?), and we
don't really want to be logging commands, we want to be logging message

There are a couple of steps that I think could be taken to make the
Prevayler approach more "smalltalky" and more manageable.  The first is to
get rid of Command objects and replace them with Message objects.  That
is, wrap a proxy around the PrevaylerSystem that implements DNU to capture
and log any messages sent to the system before forwarding them on (if
you like, you can wrap these in a Command object before serializing them,
but you'll only need that one class of Command).  This gets rid of the
ridiculous duplication of having to implement a Command class with

executeOn: aSystem
  aSystem someMessage: ...

for every message on System.

The second step is to maintain a weak dictionary mapping unique
ids to any object that passes through this proxy as a parameter, so that
these ids can be written into the log instead of the objects themselves -
you only need to fully serialize the object into the log when the id is
first assigned (and, of course, you should replace any objects that
already have ids during this serialization, with an id marker).

At that point you'd have something halfway between Prevayler and an OODB -
no transactions, still a single bottleneck for mutation, but much more
flexibility in what your commands can look like and much less overhead in
implementing them.

Marco, Stephen, thoughts?

More information about the Squeak-dev mailing list