[Zope3-dev] best practices for registry-like functionality
Jim Fulton
jim at zope.com
Thu Apr 8 14:35:54 EDT 2004
Garrett Smith wrote:
> I need to manage a set of vocabulary-like objects for a site. These
> vocab objects will be used by widgets.
>
> These objects are not content, so I want to store and manage them in a
> site management folder. Specifically, I need to be able to:
>
> - Add new vocab objects
> - Edit existing vocab objects
> - Delete vocab objects
> - Lookup a vocabulary by name
> - Get a list of all registered vocab objects
>
> In the past, I would have written a service for this, which would
> maintain its own contained set of vocab objects. But I suspect I really
> want a utility,
In particular, you want to treat each vocabulary as a utility.
> since the recent trend has been to use utilities over
> services.
Specifically, to use the utility service rather than a custom service.
> The utility would be used to lookup vocab objects and provide a list of
> registered vocab objects.
Nope, see above
> I also suspect that the utility should not contain the vocab objects,
> but that the vocab objects should instead be added directly to the site
> management folder, or perhaps to a Vocabulary-Like Objects Folder ala
> the Page Folder.
>
> I'm terribly fuzzy about the recommended approach for this sort of
> thing. Any help would be much appreciated.
Vocabulary objects are just utilities. You create them in site-management
folders and register them.
Utilities and services together are "tools". There is a management
UI for managing tools. You can define new tool types, which are really
just kinds of utilities, like "caches", "catalogs", "database connections",
"vocabularies" and so on.
I know that there already was a vocabulary service that was converted to
use the utility service. I imagibe there are artifacts for this laying around.
All of what I described is straightforward but not well documented at this
point. Sigh. It will be documented, but we haven't gotten to it yet.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list