[Seaside] Prevayler

Avi Bryant avi@beta4.com
Mon, 18 Mar 2002 12:17:15 -0800 (PST)

On Mon, 18 Mar 2002, Cees de Groot wrote:

> Therefore, the best persistence engines I've used have a clearly
> defined low-level mechanism - you register objects manually, you start
> and commit transactions manually, you know how to get to the database
> root, you handle indexes manually, etcetera. On top of this, it *may*
> provide a 'transparent' layer that automatically registers changed
> objects

Ok, I have a specific design question about this.  One thing any
persistence engine is almost certainly going to need is a mechanism for
replacing stubs with real objects as they're needed, rather than loading
everything into memory at once.  There seem to be two obvious ways of
handling this - either the stub becomeForwards itself into the object, or
the stub sticks around and just forwards all method sends to the real
object.  The thing is, although this presumably happens at a relatively
low level, the method chosen has an effect on how easy different kinds of
higher layers can be implemented.  The simple, manual transaction
management you're talking about seems best fit with the #become approach -
no nasty proxies getting in between your objects everywhere.  However, if
you want automatic detection of changes, it's much nicer to be able to
know which objects have been touched, and so a forwarder becomes very
useful.  For automatic locking, having that proxy in there is pretty

One solution would be to take an ultra-layered approach like I was playing
with in Portage, where you can mix and match different versions of each
layer.  Even without that, maybe this particular behavior should be
pluggable, and if writing a higher-level layer you can specify what kind
of stubs to use.  But it's not an entirely easy thing to make that
particular choice, well, transparent, to the rest of the system.

Thoughts appreciated.

> Papers on the Connectiva project can
> probably be found by entering 'Smalltalk Connectiva' in Google

Nope, nothing there.  Nor on citeseer.  Links?