[webbeans-dev] Re: XML configuration format
Scott Ferguson
ferg at caucho.com
Mon Dec 29 16:19:44 EST 2008
On Dec 29, 2008, at 12:10 PM, Michael Keith wrote:
>
>> The difference is that in the case of web.xml or orm.xml, there is
>> exactly one document that contains the whole schema, and the
>> developer
>> does not need to use XML namespaces. Whereas in web beans, the schema
>> is partitioned between multiple files, and there is a requirement
>> that
>> the XML author understand namespaces.
>
> Right. I meant a single canonical specification-defined schema that
> can
> be used as a reference by any and everyone that creates a config file.
The library component configuration needs validation because Web Beans
is solving a meta-configuration problem. The validation of the meta-
syntax itself is less important and less useful than validating the
configured objects themselves.
The spec's Admin example shows the value and need of validating the
object's custom configuration.
<myapp:Admin>
<ApplicationScoped/>
<myapp:username>gavin</myapp:username>
<myapp:name>
<myapp:Name>
<myapp:firstName>Gavin</myapp:firstName>
<myapp:lastName>King</myapp:lastName>
</myapp:Name>
</myapp:name>
</myapp:Admin>
If the meta-syntax were changed to a DTD style as you're proposing, it
would be easier to validate the meta-syntax, but impossible to
validate the component's configuration. Consider converting the
example to JSF 1.2 model configuration as an example DTD syntax.
True, it's easy to validate the JSF model syntax, but it's not
possible to validate the model parameters. You lose out. The result
is not simpler, nor more readable, nor more robust, despite its DTD
style.
Validation of the component's configuration is ultimately the problem
that needs solving. Validating the meta-syntax is just housekeeping.
> If I correctly understand your above description/expectation of schema
> generation, then knowing the schema(s) being generated and then
> finding,
> referencing and using them would actually add an additional level of
> difficulty, I would think.
Only if the library developer creates the schema. I'd think the
schema would be optional. If it doesn't exist, then the library
components won't be validated, but they can still be configured.
-- Scott
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20081229/dc26c3a1/attachment.html
More information about the weld-dev
mailing list