[Zope3-dev] Spaghetti-hunting
Shane Hathaway
shane@zope.com
Mon, 15 Apr 2002 12:14:24 -0400
Barry A. Warsaw wrote:
> I think this approach opens the possibility for much more code reuse
> of Python applications, by integrating into the standard Python
> extension mechanisms. For the Mailman situation, I could easily see
> people writing their own web gui's or other applications on top of the
> Mailman package (it's been talked about in the MM discussion lists).
Definitely.
> For Zope-derived software, I can easily see how other Python
> applications might like to use TAL, PageTemplate, etc. These should
> probably be top-level package names, and not be in the Zope.*
> namespace. Then, you could distutils install them and any Python app
> could just use "import TAL".
>
> Thoughts?
Well, that's what Zope 2 did. You can "import TAL" and it works. The
problem is that there are so many packages that you really don't want to
install them all in site-packages--they would cause too much clutter.
And you wouldn't want to install only some of them in site-packages,
since you want to upgrade all Zope packages together. For Zope 2, it's
usually easier to just change PYTHONPATH or sys.path if you want to use
Zope packages outside Zope.
In Zope 3, the "Zope" package has a similar purpose to the "mx" package.
(http://www.lemburg.com/files/python/eGenix-mx-Extensions.html#mxBASE)
mxTextTools, mxDateTime, and the other subpackages of "mx" aren't likely
to all be used in the same application, but it's very useful to keep
them together anyway. It makes upgrading easier.
It is possible to install Zope 2 in site-packages, but it's hard to
convince anyone to do that. Installing a single name, "Zope", is much
more attractive.
Shane