emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slot accessing issues in EIEIO


From: Stefan Monnier
Subject: Re: Slot accessing issues in EIEIO
Date: Thu, 07 May 2020 08:11:33 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> In this defclass definition. slots prefixed with "closql-" was reserved for
> internal usage. and other slots present the columns in SQL database.

> Obviously, accessing a slot in these definitions is valid. For example,
> accessing slot "foobar" in that object will trigger real slot-missing method
> because our definitions don't contain it. And accessing slots will trigger a
> sync operation between Emacs VM and SQL database.

[ By "VM" I assume you mean just the Emacs process, right?  ]

Can you point me to where/how/when the "sync" operation is done
(e.g. how does Emacs know when the SQL database is modified?  Is the
whole database mirrored during the sync or only a whole column or only
a specific element of a specific column or something else?).

> When we put the sync logic in slot-missing.  How to distinguish really
> missing slots and "simulated slots" is a problem.

The way I'd imagine it is that you'd have 2 objects, one that's a sort
of cache of the DB which could have slots like those listed in the `(defclass
epkg-package` of epkg.el, and another on top (or in front of it) which
is the one that's exposed to the rest of the code and this one only has
closql-internal slots, so `slot-missing` is always triggered for
simulated slots (and it can either answer by looking up
the slot value in the cache object, or fetch the answer from the
database and maybe store the result in the cache object).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]