On Tue, Jul 15, 2008 at 7:36 PM, Tim Cook <[EMAIL PROTECTED]> wrote:
> And in my Maildir example it implements what is defined in IMaildir but
> how does it 'provide' what is in IMaildirFactory? Specifically the
> __call__ method.
The __call__ of a class is the default constructor (the standard
__new__/__init__ dance). Static and class methods of the class can
also be used to support the interfaces of the class itself.
> So my continuing thick-headed questions is: What does classProvides
> really mean from a practical standpoint? Some kind of use case?
Well, it sounds like you've already identified it as a way to describe
the interface of the class (as a factory). It's not unusual for code
using the component architecture to locate factories for objects by
looking up a utility that provides the factory interface. That allows
some nice ways to re-use composition-based constructs.
Fred L. Drake, Jr. <fdrake at gmail.com>
"Chaos is the score upon which reality is written." --Henry Miller
Zope3-users mailing list