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

Dan Knapp dankna at accela.net
Fri Oct 22 22:27:51 UTC 2004


> an around method specializing on the standard slot-definition would
> affect all slots in all classes, unless there's something clever i'm
> not seeing.

   Okay, I figured out what I was grasping at.  You define a method 
along these
lines:

(defmethod :around direct-slot-definition-class ((class standard-class) 
&rest initargs)
     (if (member :transient initargs)
         #.(find-class 'the-elephant-slot-definition-class)
         (call-next-method)))

   Then any classes which need to will use the appropriate class for
their slots rather than the standard one.  This could also be a primary
method, which is often easier than an :around method because loading
:around methods isn't idempotent; see the docs for
direct-slot-definition-class for details.

> it depends on what you want.  things that should "just work": adding
> slots without new default / computed values; removing slots (though
> this may leave some garbage in the DB.)

   This makes sense.  Glad to hear it!

-- Dan Knapp





More information about the elephant-devel mailing list