Re: [Zope] Re: [Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python
On Thursday 11 January 2007 16:03, Dieter Maurer wrote: > Stephan Richter wrote at 2007-1-11 03:12 -0500: > > ... > >If you are populating the CA before ZCML is fully parsed, then: > > > >DO NOT POPULATE THE CA WHILE IMPORTING!!! > > > >This is so bad on so many levels. Dieter, your problem is just one > > example. Another is that unit tests have no chance to work reliably > > either. > > How do you solve the unit test issues when the CA is initialized > and populated by ZCML only? Do you fully parse the ZCML configuration > file before any unit test? For unit tests we do not use ZCML, we use the zope.component API. In those cases, however, we still do not have side-effects from importing. The unit test case is much easier, since you only test a unit and within this units conflicts of declarations are highly unlikely. > In my specific case, tests would make no problems (as we have > only a single thread) -- but of course, you had the general > case in view. Yes, I tried to make a general statement to the generall developer. My intent was not going to make a detailed discussions of all the pros and cons. After all, this was the zope@zope.org mailing list and not zope3-users or zope3-dev. ;-) Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Re: [Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python
Stephan Richter wrote at 2007-1-11 03:12 -0500: > ... >If you are populating the CA before ZCML is fully parsed, then: > >DO NOT POPULATE THE CA WHILE IMPORTING!!! > >This is so bad on so many levels. Dieter, your problem is just one example. >Another is that unit tests have no chance to work reliably either. How do you solve the unit test issues when the CA is initialized and populated by ZCML only? Do you fully parse the ZCML configuration file before any unit test? In my specific case, tests would make no problems (as we have only a single thread) -- but of course, you had the general case in view. -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python
On Thursday 11 January 2007 05:59, Chris Withers wrote: > Stephan Richter wrote: > > If you are populating the CA before ZCML is fully parsed, then: > > Why is the CA predicated on ZCML?! Because that's how it works by default. Another way of saying this is: Collect all registrations before executing them! Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python
Stephan Richter wrote: If you are populating the CA before ZCML is fully parsed, then: Why is the CA predicated on ZCML?! Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Re: [Zope-dev] Re: [Warning] Zope 3 component architecture (CA) not reliably usable for registrations from Python
On Wednesday 10 January 2007 05:45, Martijn Faassen wrote: > I'm a bit surprised why the huge [warning] is necessary. What I > understand you're saying is that you cannot use the component > architecture before it's done initializing. You also assert that you > need a registration to happen at Python import time. I'm curious to hear > more about why you need to do this - after all, you're talking about > listening to request start and end, and this happens after import time. If you are populating the CA before ZCML is fully parsed, then: DO NOT POPULATE THE CA WHILE IMPORTING!!! This is so bad on so many levels. Dieter, your problem is just one example. Another is that unit tests have no chance to work reliably either. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )