[Zope-CMF] Re: ICMFTool marker interface

Casey Duncan casey at zope.com
Mon Apr 19 10:51:52 EDT 2004


On Mon, 19 Apr 2004 16:17:45 +0200
Christian Heimes <heimes at faho.rwth-aachen.de> wrote:

> Casey Duncan wrote:
> > Would this be a base interface for all tools?
> 
> Yes
> 
> > What is the use case?
> 
> For example:
> 
> obj = getattr(portal_root, id, None)
> if obj and ICMFTool.isImplementedBy(obj):
>      raise 'It's not allowed to create an object with the same id as a
>      tool'

I would characterize this as a "blacklist" approach to content ids. IMO,
it is the exception and not the rule for a site global object to allow
it's id to be used by content. For example, do you want to allow content
to have the same id as skin methods?

At least for this case, I would suggest that a whitelist approach is
better. Zope provides a simple mechanism for this via __replaceable__,
however this was for objects in the same folder, not for checking up the
tree.

What would be an improvement though would be to differentiate between
adding content objects and adding instance space scripting objects or
tools not in the root. Currently the id check is too stupid to
differentiate between content, scripts and tools AFAIK.

-Casey




More information about the Zope-CMF mailing list