Re: [Zope-dev] ZPatterns: External Attribute Provider question

2001-03-11 Thread Phillip J. Eby

At 07:48 PM 3/11/01 +, Steve Alexander wrote:
>
>Is there a good reason that ExternalAttributeProvider sets up a 
>dictionary to put its attributes into, rather than a PersistentMapping?

It's mainly to avoid a proliferation of persistent objects, based on the
assumption that if you're using a PEAP, you probably don't have that much
else in the PersistentMapping.


>If an External Attribute Provider instead set up a new PersistentMapping 
>in its slot, only that PersistentMapping would change in the ZODB on 
>updates.
>
>Do you think this is a reasonable change for the External Attribute 
>Provider class? Or, should I write my own provider, derived from 
>External Attribute Provider, that uses a PersistentMapping instead of a 
>dict?

I would suggest creating your own provider(s).


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )



[Zope-dev] ZPatterns: External Attribute Provider question

2001-03-11 Thread Steve Alexander

Hi Phillip,

Is there a good reason that ExternalAttributeProvider sets up a 
dictionary to put its attributes into, rather than a PersistentMapping?

This is the way it seems to store things in the Rack:

Rack's BTree
   |
   + object_id
  : PersistentMapping
|
+ ('ZPatterns.Rack', 'Self')
: Persistent object, eg ZClass instance
+ ('ZPatterns.AttributeProviders','ExternalAttributes')
: {}  # dict filled with external attributes

The thing is that when the dict gets updated by the External Attribute 
Provider, the whole second-level-in PersistentMapping object gets updated.

If an External Attribute Provider instead set up a new PersistentMapping 
in its slot, only that PersistentMapping would change in the ZODB on 
updates.

Do you think this is a reasonable change for the External Attribute 
Provider class? Or, should I write my own provider, derived from 
External Attribute Provider, that uses a PersistentMapping instead of a 
dict?

Actually, I can see the use for a Persistent AttributeProvider where you 
have a configurable slot, so you can group attributes that change at 
different rates in groups of those that change together.

The second half of the slot-key's tuple would be configurable as a 
property on the attribute provider.

--
Steve Alexander
Software Engineer
Cat-Box limited


___
Zope-Dev maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )