Re: [Zope-dev] [ZConfig] import inhomogenous
Fred Drake wrote at 2004-2-18 15:01 -0500: ... importing schemas ... [DM] 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. [FD] 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. This would be an alternative. However, the change is much bigger (measured in patch size) than my ZConfig patch. ... I've not read the patch yet, so I'll ask: what's the point of the type attribute? I propose to make the type of the imported object orthogonal to the location where the object comes from. This means, you have the following options * schema component from package * schema component from url * schema from package * schema from url The type attribute specifies whether you want to import a schema component or a schema. You could do without this attribute when we would look into the resource and determine from the content what it is. 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? Currently, a wrong type lead to a ConfigurationError. Thanks for thinking critically about ZConfig. I am using it and see places where I am forced to either make significant changes or have significant code (either schema or configuration) duplications. I hate code duplications... This time I use it to automate processing Shane's QueueCatalog's. The corresponding script needs the same ZODB configuration as Zope (a complex DBTab configuration with potentially many storages). Therefore, its schema needs the zodb_db definition defined in Zope's schema. It is quite nice to use ZConfig. Thank you for this tool. -- Dieter ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] [ZConfig] import inhomogenous
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 ___ Zope-Dev maillist - [EMAIL PROTECTED] http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )