[Zope-dev] questions on ZPatterns plugin code

Andrew Wilcox circle@gwi.net
Mon, 25 Sep 2000 12:07:25 -0400


I've started browsing the ZPatterns code, and here are the questions that
came up for me while reading PlugsIns.py... Is zope-dev a good place for
this?  Would somewhere in the ZPatterns wiki be better?

The PlugInBase.manage_afterAdd() and manage_beforeDelete() methods
dynamically checks if their container has the _addPlugIn() and
_removePlugIn() methods before calling them.  Could this code be
simplified by requiring containers support an add/remove PlugIn
interface, with a default do-nothing implementation?

The PlugInContainer._addPlugIn() and _removePlugIn() will register a
plugin with multiple groups.  However _findGroupFor() appears to
assume that a plugin is associated with one plugin group.  What would
be an example of a plugin that registered itself with multiple plugin
groups?

The PlugInContainer directly accesses the __plugin_kind__ attribute of
a plugin.  Could we have a plugin.kind() method instead?

PlugIns.py patches the Zope ProductContext class to add the
_registerPlugInClass method.  Could we instead update the Zope
implementation to provide a _registerPlugInClass method, that called
the ZPatterns product if it was installed?