[Zope3-dev] what is ZCML?
Jean-Marc Orliaguet
jmo at ita.chalmers.se
Tue Mar 14 15:12:04 EST 2006
Jim Fulton wrote:
> Jean-Marc Orliaguet wrote:
>
>>
>>>
>>>
>>> I was refering to high-level ZCML, such browser:page, browser:menu, etc
>>> vs low-level directives like adapter.
>>>
>>> Jim
>>>
>>
>> I would say that they paraphrase more lines of code than the
>> low-level ones, but they fundamentally add no extremely valuable
>> abstraction since a page is an alias for a multiadapter, a menu
>> registers utilities, interfaces, ..
>
>
> Wrong. the page directive defines a class and combines multiple
> configurations. This is definately a higher level of abstraction.
>
>
OK, but that's not "violent" abstraction. For a python programming,
going to ZCML does feel like "wow, I can do some high-level
configuration of my application", we are still configuring fairly
low-level components (pages, menus, views ...), they still need to be
configured on a higher level for the application to start working. The
effort is not necessarily justified compared with how views for instance
are declared inline with the code. By looking at
zope/app/publisher/browser/viewmeta.py it is clear that most of the code
is there handle all the different page registration options (templates,
attributes, security, ..).
the fact that the "abstraction" done in ZCML does not succeed in hiding
information is an issue, IMO this is because the directives in ZCML
correspond to low-level objects and the objects' internal way of
functioning is getting too much exposed (not enough encapsulation) as
its the case with browser:page.
/JM
More information about the Zope3-dev
mailing list