[elephant-devel] Transient slots in non-persistent objects

Ben ben at medianstrip.net
Wed Oct 20 17:58:37 UTC 2004


> Hi Ben,
>
> There is nothing wrong with using persistent objects throughout the 
> application - I may indeed go that way in the end - but at the moment I'm 
> trying not to tie the database model to the application to closely. It 
> should, ideally, be possible to use any one of a number of persistent storage 
> methods.

fair enough.  You can always use macros to encapsulate declarations of
your classes.

> The database will probably be kept in memory - I'll rely on the OS to handle 
> the memory issues through VM - so the storage overhead of caching OIDs and 
> keeping buffers for detecting circularities, etc, is something I wish to 
> avoid. And objects and their slot valus need to be compared through identity.
>
> There are two ways to go: either follow the minimalist approach, or embrace 
> persistence entirely and use it throughout. Or, in other words, use a 
> memory-based or a disk-based approach. For now, I want to keep to the 
> memory-based approach, but this may well change later.

Sleepycat uses shared memory, so supposedly a lot of database
operations don't touch the disk.  As far as object identity is
concerned, it is hard to maintain that for any persistence system
across application invocations without some sort of OID system.  This
is one of the reasons to use persistent classes.

> A thought struck me: looking at #'slots-and-values in serializer.lisp, I see 
> you are using #'compute-slots, a generic function, to obtain the names of the 
> slots to be saved. Wouldn't it be possible to simply specialize on 
> #'compute-slots to obtain the effect I'm after?

yes, though doing that may be difficult cross-lisp.  If you're using
just OpenMCL, it might be not so hard.

take care, B




More information about the elephant-devel mailing list