[Zope3-dev] Re: More thoughts on packaging

Andreas Jung andreas at andreas-jung.com
Fri Feb 20 07:37:07 EST 2004



--On Freitag, 20. Februar 2004 7:19 Uhr -0500 Stephan Richter 
<srichter at cosmos.phy.tufts.edu> wrote:

> On Friday 20 February 2004 06:27, Martijn Faassen wrote:
>> I know though that this discussion won't convince anybody; XML isn't
>> very well liked in the Python community. :)
>
> I am personally not a big fan of XML either, but I like it for exactely
> the  purposes we use it in ZCML (and for remote communication, like
> XML-RPC). I do  not think that some other declarative language will do
> much better.
>
> ZCML:
>
> <adapter
>     for="zope.app.messageboard.interfaces.IMessage"
>     provides="zope.app.messageboard.interfaces.IMailSubscription"
>     class="zope.app.messageboard.message.MailSubscription"
>     />
>
> INI/ZConfig-like:
>
> [adapter]
>     for=zope.app.messageboard.interfaces.IMessage
>     provides=zope.app.messageboard.interfaces.IMailSubscription
>     class=zope.app.messageboard.message.MailSubscription
> \required empty line
>
> Now, I have no clue why people would think the latter is less verbose.
> The  same amount of lines and the latter is only shorter by the quotation
> marks  and one forward slash. This makes it worth using XML and all the
> advantages  Martijn listed.

The INI file is not less verbose...The point is that it contains three times
the same prefix which is hard to read and write. Make it shorter e.g. like:

[adapter]
     prefix=zope.app.messageboard
     for=interfaces.IMessage
     provides=interfaces.IMailSubscription
    class=message.MailSubscription

At least this is much more eye-friendly. Try to find a solution to avoid
redundancy. Zope3 contains lots of configuration file and properly
lot of redundant strings that can be avoided somehow.  I don't know
very much about the impacts of the shorter notation but the information
represented in a configfile should be easy to read.

-aj







More information about the Zope3-dev mailing list