[elephant-devel] Re: blog example w/ hunchentoot

Pierre THIERRY nowhere.man at levallois.eu.org
Fri Apr 27 18:34:16 UTC 2007


Scribit Ian Eslick dies 23/04/2007 hora 18:55:
> I'm not sure that deserializing a persistent object without actually
> creating it would make much sense.  What would you return from the
> deserializer?  What operations would it need to support?

I tend to think that deserialization should be something like
deserialize-instance (which I'll call d-i for short), and be a member of
the family of GFs whose system-supplied primary method calls
shared-initialize, viz. initialize-instance, reinitialize-instance,
update-instance-for-redefined-class, and
update-instance-for-different-class.

d-i should be a function with side-effects, that may take a placeholder
instance and move it to an instance of the proper persistent class, with
slots filled with either their transient value, their persistent value
or a placeholder instance for the latter.

> Think of it this way.  If you get a value from a persistent index and
> that value is a persistent object, then you want object identity, the
> ability to inspect it's type, slot access, etc.  The only way to do
> that is to create something in memory which provides this.  The only
> way to that is to make sure your lisp has had the chance to construct
> everything it needs via make-instance.

I'm not sure make-instance should be called here. reinitialize-instance
would be a far better choice.

> Transient Slots: they have the semantics of ordinary lisp slots - you
> cannot expect them to persist between images or after their
> placeholder has been garbage collected.

> Make-instance specializers: If you override the typical make-instance
> via :before, :after, :around or specialized on your class, you have to
> make sure that you predicate on :from-oid (this will be documented in
> the new manual) to avoid resetting persistent values.

Well, according to the spec, users should better define methods on
make-instance, but on shared-initialize or initialize-instance.

Curiously,
Pierre
-- 
nowhere.man at levallois.eu.org
OpenPGP 0xD9D50D8A
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://mailman.common-lisp.net/pipermail/elephant-devel/attachments/20070427/57ad89f2/attachment.sig>


More information about the elephant-devel mailing list