[Zope-dev] Proposal: Eliminating Globals as an import façade

Tres Seaver tseaver at palladion.com
Sat Dec 27 12:10:22 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have just checked in work on a separate branch which removes all use
of 'Globals' as an indirection for imports within the Zope2 core,
restoring the module to its original purpose, which was to hold shared
data (e.g., the opened database, etc.).

My rationale was that the current usage leads to a confusion of the
actual dependencies, as well as oddball anti-patterns based around
import cycles, etc.  I got started on the task while trying to track
down whatever import-time side effect it is which causes the current
functional test failures on the trunk.  I didn't actually *find* that
issue, of course ;(, but I did get back to the staus quo ante.  I am
more comfortable now that finding those side-effects will be possible.

I do restore the importable names in the module for benefit of 3rd party
code, but that happens only at Zope2 startup time (for now).  I would
prefer that folks change that code, but want to leave such products
workable indefinitely:  at the moment, for instance, the CMF produccts
work at appserver startup, although their tests fail (because the BBB is
added too late).

The branch is here:

svn+ssh://svn.zope.org/repos/main/Zope/branches/tseaver-no_globals_imports

I would like to merge the branch soon, because it touches lots of files
and is likely to hit conflicts if I let it go too long.  I am still
pondering whether to have the BBB imports done earlier:  I really don't
want to spew warnings about them, which is why I didn't use the
"deferred import" mechanism initially.

Thoughts?


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJVmF++gerLs4ltQ4RAlWXAKCi4QDmGsXNG0mVz09DUpCGF2Z9rQCgkcKc
8z9rLwRRaKljOGyXiQTbYdg=
=0oTI
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list