[Zope3-Users] (Ab)using utilities

Thomas Lotze tl at gocept.com
Tue Nov 29 18:16:48 EST 2005


Hi,

in an application we build using Zope 3, I've been noticing a tendency to
use utilities quite a lot.

For instance, suppose we have a top level container which holds items of
type one. There are also items of types two and three somehow connected to
the top level container. To avoid having to filter item types all the
time, we don't just want to mix them in among the type one items.

However, we don't want to put folders in the top level container to hold
all type two or type three items, resp., either. The reason being a
feeling that such folders would not provide well-defined enough access:
they might be renamed, or there might be more than one folder holding
items of either type.

Our current solution is to register utilities that handle type two and
three items, and turn them into folders actually containing the items
while we're at it. This does provide uniqueness of the type two and three
item containers, as well as well-defined access by an interface name.
However, I'm not at all sure that containing application data is what
utilities are meant for. Is it?

I get a feeling that we might want folders as attributes of the top-level
container, for all the uniqueness and well-defined access that provides.
But would that be Zope-3-ish?

-- 
Thomas



More information about the Zope3-users mailing list