[Zope3-dev] Extending a top-level ZConfig schema

Fred L. Drake, Jr. fred@zope.com
Thu, 10 Jul 2003 13:45:02 -0400


Phillip J. Eby writes:
 > Would you suggest that attributes of src's "schema" tag be applied as 
 > defaults to the extending schema, or only the contents?

The keytype attribute must be used for the extension; it cannot differ
from the "base" schema.  (That's a requiremnt for <sectiontype
extends='...'/> as well.)

The datatype and prefix attributes could be either inherited or
independent; it's not clear to me that either is intrinsically better.

 > Also, while I don't need it at the moment, how would one extend/merge 
 > multiple schemas with an extends="" attribute?
...
 > Perhaps we could use an <extend src=""> or <include src=""> tag
 > instead, then.

Perhaps.  I'd prefer <extend/> to <include/>; the difference between
inclusion and import can appear small enough that using names which
more clearly highlight their differences.

On the other hand, I'd prefer to stick with an attribute.  The fact
that one schema is an extension of another feels fairly fundamental
(is that just me?).  If we need to support the extension of multiple
"base" schema, the attribute can be interpreted as a series of
whitespace-separated references.


  -Fred

-- 
Fred L. Drake, Jr.  <fred at zope.com>
PythonLabs at Zope Corporation