users@javaee-spec.java.net

[javaee-spec users] Re: [jsr342-experts] Re: Configuration

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Mon, 25 Jul 2011 11:46:01 +0100

Hi Reza,

On 23 Jul 2011, at 00:01, Reza Rahman wrote:

> By definition, decoupling from XML as the "canonical" configuration format to something more Java centric and more readily translatable to other formats allows for more choice/flexibility. I also disagree with Pete in that I do think a Java/OO-centric format is readily intuitive and compelling to Java developers.

Sorry, I wasn't clear here. I do think there is great benefit to a Java/programmatic approach to configuration, and would strongly support this. However what I don't believe is so beneficial is a direct mapping of this OO format to an XML model. I think it is more sensible to consider them as two different approaches to configuration and use idioms/styles that suit each approach, and not be constrained by a 1-1 mapping of configuration "elements". You can see this espoused in JBoss AS 7 where we offer a number of managments APIs such as Java API, REST API, detyped API, XML API. None of these APIs are are 1-1 mapping of each other, and nor do they all expose the same level of complexity. Each has been designed to best take advantage of the "language" in which they are written. Another example of this would be Shrinkwrap descriptors API, which is by design more of a 1-1 mapping of XML into Java, but still tries it's hardest to make the Java API intuitive.

To summarize, a Java API would be very useful for Java EE however it shouldn't be a direct mapping of the XML API or vs. versa.