[elephant-devel] unique object IDs and OIDs
Tomo Matsumoto
tomoyuki28jp at gmail.com
Thu Apr 23 20:59:31 UTC 2009
Hello,
http://common-lisp.net/pipermail/elephant-devel/2008-November/004534.html
> PE> If using OID values makes sense for this purpose, is there a user-API
> PE> way to get an object by its OID?
>
>yep, via class index:
>
>(get-value oid (find-class-index 'classname))
It seems like the function named find-class-index disappeared in Elephant 1.0?
How can I do the same thing with version 1.0?
What I want to do is getting a instance by a class name and an oid.
Thanks in advance.
Tomo
> PE> I'm wondering if it is appropriate to use the OIDs that elephant
> PE> assigns objects for this purpose.
>
>yep, i think it's fine
>
> PE> Will these values change during the lifetime of the associated object?
>
>they shouldn't.
>
>oids are not preserved across export/import operations (by design of these
>export/import operations), but typically it's not a problem.
>
> PE> If using OID values makes sense for this purpose, is there a user-API
> PE> way to get an object by its OID?
>
>yep, via class index:
>
>(get-value oid (find-class-index 'classname))
>
>an internal function get-cached-instance does it in more straightforward
>way, though.
>
> PE> Should I instead add another indexed field on my object that contains
> PE> the OID value?
>
>definitely not, unless you want to use your own ids.
More information about the elephant-devel
mailing list