[Zope-dev] ZPatterns Specialist Question

Phillip J. Eby pje@telecommunity.com
Tue, 04 Jul 2000 01:11:37 -0500


At 11:54 AM 7/3/00 +0100, Chris Withers wrote:
>Just a quickie:
>
>If, as the the ZPatterns Wiki states, 'Specialists are not classes',
>then why is there a 'Specialist' python class in the ZPatterns
>distribution?
>

Specialists are instances of the class "Specialist".  They are not
themselves classes.  The reason for emphasizing that point is that it is a
common misconception of people beginning to use the ZPatterns design
approach - they conflate or confuse specialists with the class of the
things which they intend to use the specialist to gain access to.  In other
words, they assume that a specialist called "Customers" would always
manipulate "Customer" instances, when in fact it might manipulate
"SkyDiver" instances.  Most of the point of having a specialist is to have
a binding point which allows you to decouple your intended use of a thing,
from the specific implementation of it.  If one misses this point, one will
be blind to a wide variety of ZPatterns' useful applications, and at the
same time likely to ask why both Racks and Specialists are needed.  They
are both needed because the Specialist deals with a particular
problem-domain aspect of a thing, and the Rack deals with implementation
aspects.