[Zope-dev] Factory pollution, scopes, zope hosting

Lalo Martins lalo@webcom.com
Wed, 12 Jan 2000 03:11:03 -0200


I already described a problem of ``factory pollution'' I'm
facing. In short, I develop a ZClass for a very specific
problem, and then have to cope with its metatype in the
``add object'' lists of the entire site. This is a pain for
hosting providers for two reasons:

1: it pollutes the ``add object'' list. I will soon have a half
hundred metatypes. It's bad to make customers understand this.

2: perhaps I developed some class for one customer alone. For
the others it's a waste of mental space. Perhaps I even want to
charge for specific services (like, say, a shopping cart class).


I was going to settle for deleting the Factories and making
some scripts to add all instances programatically, but then I
realized there is a possible sollution. I'd like to hear
comments on it from folks with a say on Zope internals before I
move on.

This sollution is giving a ``scope'' property to the Factory
object. This property is a list of strings (represented as
``lines'') defaulting to ['/']. A given factory is only valid
in places where the path start with one of the scope strings
(so the default scope says this factory is valid anywhere, but
I could change it to ['/BroDar/nucleos', '/lalo/foobar'] so it
would stop all other places from having this metatype on their
``add object'' lists).

Is it worth? Is it a good sollution? Is the problem real, or in
my mind?

[]s,
                                               |alo
                                               +----
--
      I am Lalo of deB-org. You will be freed.
                 Resistance is futile.

http://www.webcom.com/lalo      mailto:lalo@webcom.com
                 pgp key in the web page

Debian GNU/Linux       ---       http://www.debian.org
Brazil of Darkness   --   http://zope.gf.com.br/BroDar