Java: which configuration framework to use?

Posted by Laimoncijus on Stack Overflow See other posts from Stack Overflow or by Laimoncijus
Published on 2010-03-09T09:09:02Z Indexed on 2010/03/09 9:36 UTC
Read the original article Hit count: 247

Hi,

I need to decide which configuration framework to use. At the moment I am thinking between using properties files and XML files. My configuration needs to have some primitive grouping, e.g. in XML format would be something like:

<configuration>
    <group name="abc">
        <param1>value1</param1>
        <param2>value2</param2>
    </group>
    <group name="def">
        <param3>value3</param3>
        <param4>value4</param4>
    </group>
</configuration>

or a properties file (something similar to log4j.properties):

group.abc.param1 = value1 
group.abc.param2 = value2

group.def.param3 = value3
group.def.param4 = value4

I need bi-directional (read and write) configuration library/framework. Nice feature would be - that I could read out somehow different configuration groups as different objects, so I could later pass them to different places, e.g. - reading everything what belongs to group "abc" as one object and "def" as another. If that is not possible I can always split single configuration object into smaller ones myself in the application initialization part of course.

Which framework would best fit for me?

© Stack Overflow or respective owner

Related posts about java

Related posts about configuration