[Zope-CMF] Understanding Tool Construction

Tres Seaver tseaver at zope.com
Mon Aug 4 12:16:20 EDT 2003


On Mon, 2003-08-04 at 06:41, Chris Withers wrote:

> > Okay, then what is a tool for then? 
> 
> Providing a generic service that is required for all types of CMF site.
> 
> As a general rule of thumb, most of the good candidates for tools have already 
> been implemented ;-)

Chris, your imagination is too limited here:  the existing tools cover
only a small slice of possible services / utilities.  On my current
project, we have added several *dozen* tools, of different flavors.  The
key difference between skin methods and tools is that tools often do
"heavy lifting", and hence need to be unit tested, as well as running as
"trusted code".

To address Edward's original question:

Many tools can be prototyped as a folder full of external methods: the
skin templates / methods which call them won't know or care the
difference.  If the tool needs persistent state (e.g., a relationship
service :), then it gets built that way from scratch.  Once the tool
gels, write an interface for it, and ensure that the clients depend only
on that interface, to allow easy replacement later.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com




More information about the Zope-CMF mailing list