avi at beta4.com
Fri Feb 28 09:38:46 UTC 2003
On Fri, 28 Feb 2003, Marco Paga wrote:
> You want me to create a porxy that stands before the system. The proxy
> gets all the messages that should be send to system and serializes these
> to disk. What you mean is just writing the Object>>perform:
> withArguments: to the log files? Do I have to put the logic into
> doesNotUnderstand: of the proxy class?
Yes, it'll need to go in #doesNotUnderstand:.
> But in fact it stays the same. The prevalence layer is just used behind
> the scenes. If using the above the prevayler would write the system as
> usual just the commands are created hidden. We would have a command like
> PerformCommand that keeps track of the sent commands.
> >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).
> This is not very useful in my mind. The outputs I use have a built in
> mechnism for this.
Hm. Do they? Something like ReferenceStream will maintain object
identity during a single serialization, but I don't think in your current
implementation you maintain identity across multiple commands. That is,
if you save the same object as part of two commands, and you read them
back from the log later, will the two commands you recreate actually have
the same object, or two similar but different ones? I'm pretty sure it'll
be the latter, and that's what I'm trying to avoid.
To put it another way, my understanding is that currently Command objects
should only contain Strings, Numbers, etc, that can be easily serialized
and restored. I'd like them to be able to contain any domain object, and
this means assigning ids so you can maintain identity.
This might be too different from the Prevayler idea for you to want to
implement it, but I think it would be a useful system - maybe I'll work up
a prototype this weekend.
More information about the Squeak-dev