[Zope-dev] Circular dependency hell.
Christian Theune
ct at gocept.com
Tue Apr 20 14:58:06 EDT 2010
On 04/20/2010 08:44 PM, Jim Fulton wrote:
> On Tue, Apr 20, 2010 at 12:09 PM, Christian Theune<ct at gocept.com> wrote:
>> Minor note: zope.testing *promotes* layers the wrong way and
>> zope.app.testing definitely implements them the wrong way.
>
> That's prety vague. Could you say specifically in what ways
> zope.testing promotes layers the wrong way and
zope.testing uses the attribute '__bases__' to store the information
what the base layers are. __*__ are supposedly Python internal
attributes. Specifically __bases__ is known to be used to store
information which base classes a class has.
Looking at this I (and others too) get directed towards: aha, so layers
are classes and use inheritance to signal what base layers are. Which is
exactly not what is happening.
> zope.app.testing uses them the wrong way?
Actually it doesn't. I confused this with Zope 2's Testing:
There's Testing/ZopeTestCase/layer.py which defines a class with
classmethods and in a similar fashion there is Products.PloneTestCase
that defines classes, derives them and thus kind of piggybacks on the
class inheritance mechanism to establish __bases__ paired with static
methods but without actually inheriting methods.
We struggled through some hairy details that I fail to remember when we
worked on gocept.selenium last year which tries to establish a generic
layer that can be combined with others. Looking at the layer code in
gocept.selenium right now it feels relatively clean, although the exact
choice of attribute names IMHO is confusing for anyone trying to
understand whats going on and why.
Christian
--
Christian Theune · ct at gocept.com
gocept gmbh & co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3830 bytes
Desc: S/MIME Cryptographic Signature
Url : http://mail.zope.org/pipermail/zope-dev/attachments/20100420/eff55650/attachment.bin
More information about the Zope-Dev
mailing list