-----BEGIN PGP SIGNED MESSAGE-----
Lennart Regebro wrote:
> On Tue, Dec 1, 2009 at 01:16, Gary Poster <gary.pos...@gmail.com> wrote:
>> I don't love "singleton." I think it is better than "utility." I agree at
>> least that it probably isn't better enough to introduce confusion. I'd be
>> more insistent on "singleton", or finding a better term than either of them,
>> if this were a fresh API.
> I wonder if the best isn't to make the documentation clearly say
> "Utilties are singleton components that can be looked up per
+1 to improving the documentation.
- -1 to using the term "singleton". The term is loaded up with things
that aren't relevant to what utilities do: in particular, there is no
requirement / promise that the object registered as a utilitiy is an
instance of a class, much less that its class / module jumps through
hoops to guarantee that only one instance can exist. The promise is
merely that the object returned from the lookup will provide the given
interface: no more, no less.
I have often registered functions as utilities, for instance, where the
contract of the corresponding interface was just that it be callable
with a given signature. I even recall registering a module as a
utility, although I can't find the example at the moment.
"Global objects" is a more accurate description of the things registered
as utilities from ZCML / imperative code: even that term is inaccurate
once persistent objects get registered.
 See the description of the Singleton pattern in the
Tres Seaver +1 540-429-0999 tsea...@palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists -