[Zope3-dev] Service - Utility - Utensil - Fork - Food - Chocolate - Candy...darn, now I'm hungry!

Jim Fulton jim@zope.com
Sun, 09 Dec 2001 18:53:14 -0500


Lennart Regebro wrote:
> 

...

> But anyway: I re-read chapter 5 of the tutorial too see if I could get some
> clarity, and I didn't. This was the part that cause the most confusion:
> 
>     "Utilities can be registered in specific locations (e.g. folders) in a
>     Zope object system. By passing an object to getUtility, we
>     cause local utility registries, if any, to be searched."
> 
> What is ment here? This sounds suspiciously like Zope
> ackui...aqcuic..aqcuision(?) magick.

You mean acquisition. Yes, acquisition is a useful feature of Zope 2
that will be available in Zope 3. Acquisition will usually be used
in a far more explicit manner in Zope 3 than in Zope 2.

> Are
> you saying that you register utilities in the ZODB?

Yes, you can. You can also register them globally, which is the
only mechanism implemented so far.

> Because if you do, I
> can't see any difference between utilities or services at all. I first
> thought that utilities was stored on disk and not as objects in the ZODB,
> which seems logical too me, but now I'm just confused.

No, the difference has nothing to do with how they are stored.

See if
http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/DifferencesBetweenServicesAndUtilities

helps.
 
(snip)

> *** Summary: ***
> I can see two types of objects here:
> 
> 1. A class, of which instances lie in the ZODB, that has an internal state
> changeable by functions or userinterface, which other objects will ask
> to perform actions, which may depend on this internal state.
> I would call these "Services".
> 
> 2. A class, which is not instanciated in the ZODB, has no internal state,
> which has functions that perform actions on objects that are passed to the
> function.
> I would call these Tools or Toolboxes. Or Utilities or Utensils, possibly.

Where an object is stored or how much state it has is not significant.
 
> I'm not sure which of these the "Postal" object in the tutorial is.

There is no "Postal" object in the tutorial. What class are you refering
to?

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org