Hi Gary,

please apologize the late reply, unfortunately I got too deeply
involved in fixing Modello issues :P

The main differences between 2 approaches are the following:

 * XML parsing actually is performed on DOM analysis, Modello
generates (in therms that generates .java files) StAX APIs based
Reader/Writer classes;

 * JSON parsing is delegated to jackson-core + jackson-databind, while
Modello generates Reader/Writer classes based on jackson-core
streaming APIs only;

 * Both previous approaches don't use introspection to (un)bind data,
the model analysis is performed only once at compile time;

 * JSON version of the Modello generated writer is more readable and
less verbose;

 * no boilerplate code to maintain: given the configuration model
definition, Modello automatically generates the classes, the related
builders/static utility methods, XML+JSON+YAML (un)marshallers; what
we would need to maintain is the "syntax tree" model process.

HTH,
-Simo

http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi


On Fri, Jun 14, 2013 at 10:05 PM, Gary Gregory <[email protected]> wrote:
> Hi Simo,
>
> This sounds interesting.
>
> Can you describe in a little more depth what it is you are proposing, how it
> differs from what we have now, why it is better and so on?
>
> Thank you,
> Gary
>
>
> On Wed, Jun 12, 2013 at 5:40 AM, Simone Tripodi <[email protected]>
> wrote:
>>
>> Hi all mates,
>>
>> I recently got involved in the Modello project[1], adding some useful
>> stuff such as JSON and YAML (un)marshallers generation and took some
>> existing configurations as sample to test the quality of new
>> marshallers... and "accidentally" took also the Log4j2 configuration.
>>
>> So, I tracked my progresses in a private project that I just shared on
>> GitHub[2] in the case some of you would like to have a look and, since
>> Log4j2 is still under beta version, I wonder if there is enough space
>> to discuss the inclusion of that configuration (has to be completed,
>> I'm sure I missed some elements) in the current trunk development,
>> these are the added value with the new approach:
>>
>>  * One single model definition and Java POJOS/XSD/XML/JSON/YAML
>> support generated with 0 effort;
>>
>>  * Users have APIs to describe and generate Log4j configurations in
>> different formats;
>>
>>  * All parsers/serializers are based on Streaming APIs (jackson-core
>> for JSON, snake-yaml for YAML);
>>
>>  * XML format[3] differs a little to current format when defining
>> properties, but it is a little less verbose;
>>
>>  * lighter, less verbose JSON notation[4];
>>
>>  * new YAML support[5];
>>
>> Last, but not least, have a look at the generated APIs[6]!
>>
>> WDYT?
>> Many thanks in advance, all the best!
>> -Simo
>>
>> [1] http://modello.codehaus.org/index.html
>> [2] https://github.com/simonetripodi/log4j2-config/
>> [3]
>> https://github.com/simonetripodi/log4j2-config/blob/master/tests/src/test/resources/org/apache/logging/log4j/config/io/log4j.xml
>> [4]
>> https://github.com/simonetripodi/log4j2-config/blob/master/tests/src/test/resources/org/apache/logging/log4j/config/io/log4j.json
>> [5]
>> https://github.com/simonetripodi/log4j2-config/blob/master/tests/src/test/resources/org/apache/logging/log4j/config/io/log4j.yaml
>> [6]
>> https://github.com/simonetripodi/log4j2-config/blob/master/tests/src/test/java/org/apache/logging/log4j/config/io/AbstractConfigurationTestCase.java
>>
>> http://people.apache.org/~simonetripodi/
>> http://twitter.com/simonetripodi
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>
>
>
> --
> E-Mail: [email protected] | [email protected]
> Java Persistence with Hibernate, Second Edition
> JUnit in Action, Second Edition
> Spring Batch in Action
> Blog: http://garygregory.wordpress.com
> Home: http://garygregory.com/
> Tweet! http://twitter.com/GaryGregory

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to