[Zope-dev] [ZConfig] "import" inhomogenous

Fred Drake fred at zope.com
Wed Feb 18 15:01:16 EST 2004


On Tuesday 17 February 2004 01:10 pm, Dieter Maurer wrote:
 > It would be better if the type of the imported
 > object (schema or component) were orthogonal
 > to the location from where the object is found
 > (in a package or via an URL).

I agree, that does seem nicer.

Another approach would be to deprecate the <import src="url"/> form, so we 
only need to deal with components.  The original src="url" flavor was 
created before schema components had been thought through, and I'd be happy 
to see that go.

 > A use case is the import of the section types
 > defined in "Zope.Startup.zopeschema.xml" for
 > other ZEO applications that require access to the
 > same ZODB database(s). It is far more
 > convenient to access this schema via "package"+"file"
 > than an URL.

Is there some reason not to simply move the section types to a schema 
component?  That seems more in the spirit of making the schema modular.

 > The attached patch adds an additional "type" attribute
 > to the "import" element. It can take values "schema"
 > or "component" and determines the type of object to
 > be imported. Its default value ("") is handled to
 > provide backward compatibility.

I've not read the patch yet, so I'll ask:  what's the point of the "type" 
attribute?  Should it be an error if the type doesn't match the top-level 
element of the resource?  If only advisory, is it actually useful?

Thanks for thinking critically about ZConfig.  Yes, I'm aware there are some 
proposals for changes I've not yet addressed.  ;-)


  -Fred

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




More information about the Zope-Dev mailing list