[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
method discrimination on persistent objects
- To: commonloops.pa@Xerox.COM
- Subject: method discrimination on persistent objects
- From: larry%postgres.Berkeley.EDU@berkeley.edu (Larry Rowe)
- Date: Wed, 6 Jul 88 12:06:20 PDT
- Cc: Gregor.pa@Xerox.COM
- Redistributed: commonloops.pa
We are implementing a persistent object system that stores CLOS
objects in an extensible database system (POSTGRES). Since pointers
have to be stored symbolically in the database, each persistent object is
represented by a unique object identifier, called an objid.
We would like to make all references to persistent objects, whether
they are in main memory or in the database, an objid.
We have implemented a main memory cache for persistent objects
to improve performance. The cache maps objid's to objects.
Currently, the cache contains a lisp pointer to the object.
We have modified the make-instance function so that it returns the
objid for the new object. In addition, slot-value has been modified
to accept an objid and to lookup the object in the cache. However,
we have had a difficult time modifying the PCL code to support method
invocation on persistent objects. The problem arises because the
objid's are not instances of the represented class. We have explored
three approaches to fix this problem and thus far we have not been able
to make any one work:
1. change the behavior of the class-of function to return
a pointer to the class object when given an objid. note that
the class object will also be a persistent object so the
return value should be an objid or, to optimize method lookup,
a lisp pointer.
(this failed because we couldn't figure out where to
make this change. we looked at class-of-1 and get-class-1
but couldn't figure out where the change should be made.)
2. change the discriminating-function for the generic-function.
(this also failed because we couldn't figure out how
to make the change. moreover, it was clear that this approach
would not survive future enhancements to the PCL/CLOS
3. change the main memory representation for an object to be
a handle that contains the following slots: a class reference,
an objid, lisp pointer to the actual object.
(we haven't tried to implement this approach yet because
it requires changes to the low-level implementation of PCL.)
Before we embark on this third approach we thought we'd query the
community to see if anyone else has an idea how we can solve this
problem without having to muck with the low-level implementation.
It seems like the CLOS metaclass protocol ought to support this kind of