[Zope3-dev] ZCML alternative

Jim Fulton jim@zope.com
Tue, 04 Jun 2002 18:22:36 -0400


Shane Hathaway wrote:
> 
> Steve Alexander wrote:
> > Namespaces are important for making the configuration system extensible.
> 
> Jeffrey's example was *a lot* easier to read.  Site managers are a lot
> more familiar with that kind of XML than namespace-loaded XML.

I *totally* disagree.

> We can have extensibility without namespaces. 

How? I don't think so.

> The extensibility would
> be more limited, but in fact, it currently seems too inviting for
> developers to create their own directives.

I don't buy that.
 
> Here's your example rewritten in more conventional XML.  If we're using
> XML to make ZCML familiar, we'll gain the most mileage by using a
> familiar style of XML.
> 
> <permission id="Zope.Manage">Manage Contacts</permission>
> 
> <content class="Zope.Contact.">
>   <require permission="Zope.View">
>    <attribute>name</attribute>
>    <attribute>first</attribute>
>    <attribute>last</attribute>
>    <attribute>email</attribute>
>    <attribute>address</attribute>
>    <attribute>postal_code</attribute>
>   </require>
>   <require permission="Zope.Manage">
>    <zmi-factory id="Zope.Contact">
>     <title>Contact</title>
>    </zmi-factory>
>   </require>
> </content>

You find that more readable than:

   <security:permission
       id="Zope.Manage"
       title="Manage Contacts"/>

   <content class="Zope.Contact.">
     <security:require
         permission="Zope.View"
         attributes="name first last email address postal_code" />
     <zmi:factory
         id="Zope.Contact"
         permission="Zope.Manage"
         title="Contact" />
   </content>

I find this unfathomable.

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