Re: Object created events

"Kapil Thangavelu" <k_vertigo-5YxZ1of64+Pk/[email protected]> Wed, 27 Sep 2006 08:07:22 -0700
Newsgroups gmane.comp.web.zope.plone.archetypes.devel
Organization ObjectRealms, LLC
Message-ID <[email protected]>
On Wed, 27 Sep 2006 07:12:45 -0700, Martin Aspeli <[email protected]> wrote:

>
>
>
> Rocky Burt wrote:
>>
>>> Who and when and on which branch?
>>
>> Me with r6999 on the 1.4 branch.  This was per mine and Daniel's
>> discussion (he insisted I make this change and I agreed).  He said he
>> would also propagate this change to 1.5 but I haven't confirmed this was
>> completed.
>>
>
> Ah - cool. It's not on the branch whit and I cut a couple of days ago,  
> which
> is why I asked.
>
> I'll go and add the created events tonight, unless someone yells.
>

i think this needs a proposal and to be thought through rather than code  
just landing.

i think created events are the wrong semantic, z3 fires them for class  
instantiation/factory creation, and you want them for object  
initialization in context, which are different use cases. i'd rather some  
subclass of modified event for initializated that fired only once.

also the point that rocky makes that this stuff shouldn't be in base AT  
classes, is valid imho, z3 events are typically fired by view code and  
putting inline with method calls, means like some serious headaches for  
existing software. for example as soon you add in hacking in a few  
modified events and hook up an indexer to it, you now have the fragile at  
manager_after add dance, and api usage generating events, causing  
indexing, resulting in extraneous duplicate indexation calls, which just  
makes the system harder to assume any deterministic behavior for.  
basically lots of code thats using the api isn't expecting to generate  
events, is suddenly going to be generating events, and unless we have a  
coherent story about moving AT to it, doing it piecemeal in adhoc fashion  
is likely to be dentrimental and destabilizing, imo.

-kapil

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV