[Zope-PTK] Hooks

Shane Hathaway shane@digicool.com
Fri, 18 Aug 2000 08:00:46 -0400


Fabio Forno wrote:
> In my not very deep Zope experience, the first two options need
> sublassing and making a new product having PTKBase and also PTKDemo (If
> you want to keep all the good things there are in there ;)) classes as
> base classes. This can be done both at low level python code or with
> ZClasses, I think it depends on the control you need. Anyway for much
> more simple tasks, when you need just to add some functionality in
> response to certain actions and all the base is good for you, I think
> that hooks may be a great shortcut.

In my not very deep PTK experience, there was never a way to add hooks
without subclassing.  Please correct me if I'm wrong.

I just realized there are two more options:

4) Make these tools into ObjectManagers.  Then you could hook anything
you want just by adding methods to the tools.

5) Make use of the observer pattern that was recently added. 
Unfortunately, I don't know where it is.

Shane