[Zope3-dev] factoryFromClass: for_container

Lalo Martins lalo@laranja.org
Tue, 16 Apr 2002 15:32:54 -0300


On Mon, Apr 15, 2002 at 02:34:14PM -0400, Jim Fulton wrote:
> 
> BTW, another way to approach this is to have containers say which kinds of
> things they are willing to contain, by specifying an interface that their items
> must support. Maybe this is related to what you are proposing.

These two things are complementar.

Having a factory zcml is good because you can make new types available in
existing containers and existing types available in new containers. This
makes the set broader.

Being able to filter by interface is also interesting, because it makes the
set narrower.

Or in other words:

If we only had interface filters, it would be a pain to create a new class
and declare that it can be added to JobBoards.

If we only had Gary's way, then a Job object could only be created in a
JobBoard, but the JobBoard add list would have Job *and* all other things
IContainer has.

So I think if the goal is to mimic (or beat!) the factory flexibility in Z2,
then we need both.

[]s,
                                               |alo
                                               +----
--
  It doesn't bother me that people say things like
   "you'll never get anywhere with this attitude".
   In a few decades, it will make a good paragraph
      in my biography. You know, for a laugh.
--
http://www.laranja.org/                mailto:lalo@laranja.org
         pgp key: http://www.laranja.org/pessoal/pgp

Brazil of Darkness (RPG)      ---       http://www.BroDar.org/
Python Foundry Guide http://www.sf.net/foundry/python-foundry/