Re: [Zope-dev] References, persistence, BTrees

2002-01-03 Thread Phillip J. Eby

At 05:49 PM 1/3/02 -0700, Jeffrey P Shell wrote:

>'subscriber' is a reference to the subscribing object, and it's very 
>likely to be to an object in the ZODB.  Is it wise to have more than one 
>persistent reference to a single persistent object?
>I swear that I had once heard Jim say (vocally) that you could do 
>references like this in the ZODB now.  I'm trying to avoid using Paths 
>because objects have a tendency to move around[*], and I have performance 
>concerns for a single event service object to have to call 
>'unrestrictedTraverse' to every subscriber.

Unfortunately, you can't take this shortcut.  Not because you can't store 
or retrieve references in this way, but because you can't get an 
acquisition context this way, which means security is shot, not to mention 
things like objects knowing their URLs.  So although it's perfectly safe to 
point to objects in the ZODB from more than one place, it's almost always 
useless to do so with respect to an arbitrary Zope object.  :(

I don't know if this is changing in Z3, but I'm rather curious about the 
possibility, myself.


___
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] References, persistence, BTrees

2002-01-03 Thread Jeffrey P Shell

I'm experimenting with an event notification service based on a 
publish-subscribe model for some projects I'm working on.  When a 
subscription comes in, a 'Subscription' object is made, that 
basically looks like this:

class Subscription(Base):
 def __init__(self, subscriber, eventType, filter=None):
 self.subscriber = subscriber
 self.eventType = eventType
 self.filter = filter

 def __hash__(self):
 return hash(self.subscriber) & \
hash(self.eventType) & \
hash(self.filter)

'subscriber' is a reference to the subscribing object, and it's 
very likely to be to an object in the ZODB.  Is it wise to have 
more than one persistent reference to a single persistent object?  
I swear that I had once heard Jim say (vocally) that you could do 
references like this in the ZODB now.  I'm trying to avoid using 
Paths because objects have a tendency to move around[*], and I have 
performance concerns for a single event service object to have to 
call 'unrestrictedTraverse' to every subscriber.

[*] (it's due to the annoyances with manage_beforeDelete() and 
friends that
I'm writing this tool.)

Second question: If I use the hash of the Subscription as a key, is 
there any advantages/disadvantages with using an IOBTree to hold 
Subscription objects instead of a PersistentMapping?

Jeffrey P Shell, [EMAIL PROTECTED]


___
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] Python Conference

2002-01-03 Thread Joya Subudhi

Python 10 Conference News

Python 10 is just around the corner. Register today and save with EARLY
BIRD REGISTRATION RATES. This early bird offer ends on January 7, 2002.
To register, go to http://www.python10.org/p10-regInfo.html

The Python 10 GROUP RATE at the Hilton Alexandria Mark Center is only
guaranteed until January 11, 2002. For information on room rates and
reservation procedures, please go to
http://www.python10.org/p10-hotelInformation.html

Feature Presentation: Developers' Day opens with the "State of the
Python Union" Address by Guido van Rossum

Birds-of-a-Feather: Python 10 is now calling for your Birds-of-a-Feather
(BoF) submissions. To propose a BoF, please go to:
http://www.python10.org/p10-callBoFs.html

The Tenth International Python Conference, February 4 - 7, 2002
The Hilton Alexandria Mark Center, Alexandria, Virginia
http://www.python10.org
Silver Sponsor: Hostway Corporation: http://www.hostway.com
Silver Sponsor: New Riders Publishing: http://www.newriders.com
Exhibitor: Archaeopteryx Software: http://www.archaeopteryx.com



___
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 )