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


_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to