[ZODB-Dev] Re: ZEO signal feature

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 30 Sep 2002 09:36:03 +0100


On Tuesday 24 Sep 2002 4:21 pm, Jeremy Hylton wrote:

> Wouldn't it be more natural to extend the storage interface
> dynamically by adding new methods

I have an implementation of this approach on toby-extension-method-branch

A new storage method getExtensionMethods is used to declare the existence=
 of=20
extension methods. It returns a dictionary whose keys are method names
(dictionary values are not used yet, but will be useful if we ever want t=
o add=20
extra information to these declarations)

The ZEO client storage uses this declaration in a __getattr__ hook to pro=
vide=20
extension methods as attributes of the client storage object.

On Friday 27 Sep 2002 6:28 pm, Jeremy Hylton wrote:

> It does?  Do you mean because you can type db._storage and get access
> to a storage object?  An instance variable starting with an underscore
> is intended to be private.

Hmm, yes. Thankyou for making me feel dirty.

Originally Christian Reis suggested that extension methods of the storage=
 be=20
made available as methods of the DB.  The DB is already setting up delega=
tion=20
of several methods (in the section commented "# Pass through methods") so=
 I=20
guess it could delegate extension methods too, using getExtensionMethods =
to=20
determine their names.



(a getExtensionMethods-compatible DirectoryStorage is available on=20
extension-method-branch)