[Zope3-dev] IFactory, and composite factories

Jim Fulton jim@zope.com
Tue, 03 Sep 2002 09:53:30 -0400


R. David Murray wrote:
> On Sun, 1 Sep 2002, Jim Fulton wrote:
> 
>>>>The factory attribute in ZCML is for creating other kinds of components.
>>>>Adapter factories take a single argument. Resource factories take a
>>>>single argument (the request). View factories take two arguments, context,
>>>>and request. Utility and service factories take no arguments.
>>>>
>>>>
>>>And I think I should include this info as well.
>>>
>>Yes.
>>
> 
> What's the calling sequence for securityPolicy factories?  A grep didn't
> turn up any examples of an actual securityPolicy declaration, so I
> couldn't find any example callables to look at <grin>.

That's because the factory attribute isn't supported for the
securityPolicy directive. It appears, however, that you can
provide a callable object (i.e. a factory) and it will be called
without arguments.  See

   lib/python/Zope/App/Security/metaConfigure.py

I'd prefer that there be an explicit factory attribute.
Want to add one?

Jim


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (888) 344-4332            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org