[Zope3-dev] More name game suggestions

Martijn Faassen faassen@vet.uu.nl
Sun, 9 Dec 2001 18:58:10 +0100


Guido van Rossum wrote:
> > Should we be making the distinction between 'services' and 'utilities' at
> > all? Isn't a utility some sort of simple degenerate service?
> 
> I'll stay out of the naming discussion (this is Zope's cross to bear)
> but the practical distinction becomes clear from the description of
> how they are used in Jim's original Wiki page
> 
>  http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/SecurityFramework

Wrong page? Can't find anything on utility on this page.. 

> When you use a "service", there is this notion that you vaguely ask
> for one and the one nearest to you gets the request; that one will
> communicate with others of the same kind higher up in the hierarchy
> and eventually give you a result.  (Similar to methods and method
> overloading.)
> 
> When you use a "utility" you pick one you like and that's the one you
> get.  (Similar to a function, I guess.)

Yes, I got a similar impression, but apparently either Ken typoed or has
a different idea (or I read him wrong). From his new cheatsheet:

> Service component type

> Core tools whose functionality is used by many different types of
> components - correspond to CMF "tools". Service manager is the most
> fundamental - the "big flat lego sheet, on which the rest of the legos
> are placed".

> Contrast with Utility - name of Service is crucial, can have multiple
> services that implement same interface in the same place, distinguished 
> by name.

> Utility component type

> Like Services, Utilities are independent resources, but aren't
> foundational - they're generally specific to an application or
> application domain. For Services, the interface is the crucial aspect
> - can not have utilities that serve the same interface (purpose) in the
> same place.

I'm confused. Isn't it exactly the other way around in that there can be
multiple utilities in one place with the same interface, distinguished by
name? With services I have the concept of 'gimme the nearest authentication
service' or 'gimme the ZDOM service that applies here' (sorry Jim, still
don't see how a DOM is part of a presentation or view component..) or
whatnot. That seems like there can be only a single services in a place
for a certain interface..

Though taking the XML parser example, utilities seem to be global in
some sense as well. But then I think in terms of 'give me the XML parser'..
But isn't that much like a service? It seems like a global service type
thing, while utilities are supposed to be application specific. To me
that implies local. (though application domain specific, such as XML,
could indeed be global) 

I'm still not convinced this difference is a qualitative one, or that the
line is drawn in the right place. But even if I'm wrong, what we need
now is a set of good examples of both utilities and services and
reasons for each one explaining why it's a service, or a utility, and why
not something else again, like an adapter.

The fact that Phillip Eby is confused shows enough! :)

Could we fit the word 'module' into all of this somehow? It would strike
me as if many utilities are basically Python modules plugged into Zope
somehow (or created inside Zope), is that correct?

Regards,

Martijn