I need to decide which configuration structure to use. At the moment, I am thinking about using property files and XML files. My configuration should have some primitive grouping, for example. in XML format there will 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 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 a bi-directional (read and write) library / configuration structure. A good feature would be that I could read somehow different configuration groups as different objects, so I could later transfer them to different places, for example. - read everything that belongs to the group "abc", as one object, and "def" as another. If this is not possible, I can always split one configuration object into smaller ones in terms of application initialization.
Which structure is best for me?
java xml properties frameworks configuration
Laimoncijus
source share