Chris McDonough wrote:
I did a bit of research on the direct "zope.app.*" dependencies of zope.formlib.
- I looked into its dependency on zope.app.pagetemplate. It defines two "named templates" in its form.py module using The ViewPageTemplateFile class from zope.app.pagetemplate. Each is registered in its configure.zcml as adapter with the name "default". I don't have enough zen to know what the intent is here or whether the named templates could use zope.pagetemplate instead.
This is part of the whole named template adapter story. The rationale for the whole story is to be able to replace the template of a view without touching the view. So the template is looked up as an adapter and not just accessed as self.index / self.template. Personally I find the whole feature just annoying and overcomplicated. I think the whole feature is due for removal. It's only used in a very minor number of cases and not consistently with views in general.
- I looked into its dependency on zope.app.form. It essentially uses a bunch of interfaces from the zope.app.form.interfaces package. I don't know whether it would be reasonable to move all those interfaces to zope.browser or somewhere else, but essentially moving those interfaces to somewhere "neutral" would break this particular dependency.
Why not move the interfaces to zope.formlib and invert the dependency, so zope.app.form depends on zope.formlib? Or are these generally useful outside of a formlib context? Hanno