[Chandler-dev] Observers and stamps

Jeffrey Harris jeffrey at osafoundation.org
Wed Nov 29 16:42:10 PST 2006


Hi Bryan,

> Unless there are more cases of observers on stamps observing attributes
> on ContentItem, I think it'd be better to put the overhead of checking
> for stampedness in the individual observer, to avoid adding overhead to
> all notifications.
> 
> (Also, wouldn't checking stampedness in the dispatch mechanism prevent
> you from getting notified when an EventStamp'd item is unstamped, and
> removed from collections as a result?)

At the moment there appears to be only one other observer of a
ContentItem attribute, in the script module.  But since Script is a new
kind, not a stamp, its observer on ContentItem.body behaves the way I
was expecting EventStamp's observer to, it only gets called when Scripts
are changed.

I think you're right that observers may want to pay attention to
unstamp-related collection changes.  All in all, you've convinced me
this isn't a good idea, we should just be careful with observer methods
and not assume (like I erroneously did) that the method will only be
called on items that have that stamp.

Sincerely,
Jeffrey


More information about the chandler-dev mailing list