[Zope-dev] refactoring site functionality

Wichert Akkerman wichert at wiggy.net
Thu Jun 4 13:31:03 EDT 2009


Previously Chris McDonough wrote:
> On 6/4/09 11:59 AM, Martijn Faassen wrote:
> > Wichert Akkerman wrote:
> >> Previously Martijn Faassen wrote:
> >>> * often it is nice to have application configuration to have a user
> >>> interface, so that end users can configure aspects of the application.
> >>> This may be filling in an email address or customizing a template or
> >>> adding a user, etc. Local utilities are a nice solution for this, even
> >>> if there is just a single application installed.
> >> That sounds like a complicated workaround for not having a mutable
> >> global configuration.
> >
> > I don't think it's complicated. It's nice to install an object somewhere
> > that stores data and has a UI and also be able to register it as a local
> > utility. If you were to have mutable global configuration, you'd need
> > some way to expose it to the UI and content-space too.
> 
> This is true.  OTOH, I've never really been keen on the idea that the CA API 
> should be bent around the idea that you're going to often want to find a 
> persistent registry.  It seems just as reasonable to:
> 
> - put a persistent object someplace (with its own UI) that isn't registered as
>    a CA utility.
> 
> - find it via the location API when you need it in your code.
> 
> - *Pass* it to global utilities (or adapters) when you need to vary behavior
>    based on location.
> 
> Maybe CMF tools weren't such a bad idea.

For Plone we regret that we used persistent utilities to store
configuration: they have made Plone instances much more fragile
(removing a utiliy's implementation breaks the whole site) and forces
you to write a UI for the stored configuration again and again. To move
forwards we have come up with plone.registry (see
http://pypi.python.org/pypi/plone.registry), which gives you a nice
central storage system for configuration.

Wichert.

-- 
Wichert Akkerman <wichert at wiggy.net>    It is simple to make things.
http://www.wiggy.net/                   It is hard to make things simple.


More information about the Zope-Dev mailing list