[Zope-dev] implementing zope.component 4.0

Hanno Schlichting hanno at hannosch.eu
Tue Dec 1 09:57:08 EST 2009


On Tue, Dec 1, 2009 at 3:38 PM, Martin Aspeli <optilude+lists at gmail.com> wrote:
> I'm certainly -1 on using the term in the ZCA. I think changing our
> nomenclature would be terrible for the same reasons I think changing (as
> opposed to extending/improving) our API would be terrible. Utilities are
> in one way a more specific concept (due to the lookup semantics) and in
> another way a more generic concept (since named utilities can be used to
> implement a registry of homogenous objects).

And once you mix in location dependent utilities aka. local utilities
you lost almost all of the singleton idea. Now suddenly you can get a
different instance depending on the execution context, which might not
be obvious from the location of the lookup in the code.

You still get an instance conforming to an interface, though. So in a
sense this is indeed more like a null-adapter. All adapters or
utilities have the global process or execution context as an implied
dimension, even it's bad practice to rely on that hidden dimension too
much, we do that all the time with thread globals like the database
connection.

Hanno


More information about the Zope-Dev mailing list