[Zope3-dev] z3 in z2 land, zcml vs. yaml, and a new year

Casey Duncan casey at zope.com
Wed Dec 31 13:35:06 EST 2003


On Wed, 31 Dec 2003 17:42:38 +0000
tav <tav at espians.com> wrote:
[snip lots of interesting stuff]
> if so, i would like to use some features of z3 in z2 now, and would,
> again, appreciate some guidance:
> 
> 1. interfaces.
> 
>    i understand that z3 interfaces and z2 interfaces differ
>    substantially.
>  
>    so, can i simply grab zope.interface and zope.schema from z3
>    and use them in z2?
> 
>    i don't see why, but one can never be too sure in the magical
>    world of z2. will things break if i do so?

There is an interface "bridge" package found in cvs.zope.org/Packages3/Interface that can be used for interfaces that will work in both Zope 2 and Zope 3. 
 
> 2. new-style classes.
> 
>    why exactly are all classes in z3 new-style classes?
> 
>    can i simply use new-style extensionclass from zope HEAD,
>    and then specify new-style classes in z2?
> 
>    does everything needed for this work now, or do changes
>    have to be made still?
> 
>    can i use old-style classes and then move onto new-style ones?
>    what are the implications of this?
> 
>    i apologise for my ignorance on this front, but would
>    appreciate some enlightenment.

I think Zope 3 classes are new-style for the most part because there is fairly common usage of new-style only features like descriptors.
 
> now, i understand that some of you (zope corp and martijn in
> particular), have made use of z3 in z2 land.
> 
> is this true? if so, could you please provide some brief details? many
> thanks!
> 

We have several projects interally (specifically Zope4Intranets) that use Zope 3 components (such as Schema) in Zope 2. The primary low level integration point is the bridge Interface package. There is a fair bit of work to make both sides happy (for example you must disable Zope 3's security which Zope 2 cannot deal with yet), but it can be successfully accomplished. There is pain involved and Zope 3 is still a moving target so be forewarned that it's not without cost.

> #/#
> 
> finally, on the topic of zcml, i have to unfortunately express serious
> discontent =(
> 
> i was obviously not there when the decisions were made, so arguably i
> have no right to be discontent, but i shall make a plea nevertheless.
> 
> zcml terrifies me.
> 
> and, i am not alone in this regard.
> 
> zcml will be, as far as i can tell, the biggest barrier to zope3 adoption.
> 
> separation of component configuration is obviously quite attractive, but
> i have to ask... is it necessary for it to be so "powerful" ?
> 
> it reminds me a lot of the rdf world, where certain attractive
> abstractions were implemented, resulting in something so complex and
> powerful that in 6 years of rdf, very little of value has been achieved.
> 
> secondly, if it's seen to be absolutely necessary, can we at least use
> an alternative format? emacs with the nxml-mode makes zcml just about
> palatable, but unless i had spent a *lot* of time developing in it, i
> would still be terrified by it.
> 
> can i suggest yaml <http://yaml.org> as a potential alternative. e.g.
> compare and contrast:

yaml was suggested early on during discussion we had internally about configuration languages. Jim decided against it in favor of XML. Many people including myself have voiced concern about ZCML, but Jim has made several proclamations that it is here to stay for better or worse (search the list archives for specific threads).

OTOH, there have been many iterative efforts to clean it up and make it more terse. Yaml might help make it cleaner, but it wouldn't, by itself make it semantically simpler. There is a lot invested in the XML implementation of ZCML as it stands, so unless someone stepped in and landed a completely and unmistakeably (to Jim) better solution it is doubtful in my mind that it would take hold.

But I could be wrong.

-Casey



More information about the Zope3-dev mailing list