On 5/26/05, Jim Fulton <[EMAIL PROTECTED]> wrote:
> Given the applications above, I don't think that there's value in
> fine-grained modification events that justifies the complecity of
> proposals we've thought of so far.
>
> 
> Thoughts?


I doubt the event system needs to be much more fine-grained.  If you
want an event to tell you when a particular property value has
changed, it's easy enough to use a custom field that wraps set() and
spawns a custom change event, e.g:

# untested...

class SearchableTextLineModified(ObjectEvent):
    def __init__(self, object, changed_field):
        ObjectEvent.__init__(self, object)
        self.changed_field = changed_field

class SearchableTextLine(TextLine):
    def set(self, object, value):
         TextLine.set(self, object, value)
         notify(SearchableTextLineModified(object, self.__name__)) 

If you use this field type for all text properties you want searched,
your text index can simply ignore all change events beside the one(s)
you care about and *then* only act on the specific fields changed. 
Other tools that depend on built-in change events should still work.

This approach has the advantage of providing events that are as
fine-grained as the developer wishes them to be and pushes
resposibility for managing any resulting complexity sqarely on the
developer's shoulders.  I doubt that making Zope's built-in events
more complicated is the way to go.

FWIW, $.02, etc,

Dylan





> 
> Are there other applications for modification events that
> I haven't considered?
> 
> Jim
> 
> --
> Jim Fulton           mailto:[EMAIL PROTECTED]       Python Powered!
> CTO                  (540) 361-1714            http://www.python.org
> Zope Corporation     http://www.zope.com       http://www.zope.org
> _______________________________________________
> Zope3-dev mailing list
> Zope3-dev@zope.org
> Unsub: 
> http://mail.zope.org/mailman/options/zope3-dev/dylanreinhardt%40gmail.com
> 
>
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to