xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefano Mazzocchi <stef...@apache.org>
Subject Re: USES
Date Thu, 17 Feb 2000 10:46:14 GMT
Paul.Waugh@wdr.com wrote:
>      Interesting thread,
>      Just as an aside, has anyone started to put property files in an XML
>      format.
>      I was just wondering if there is an advantage moving from a property
>      file or .ini file that was the format.
>      name=something
>      windowsize=anything
>      blahblah=somethingelse
>      to a guess below
>      <propertyset>
>         <property>
>                 <name>something</name>
>         </property>
>         <property>
>                 <windowsize>something</windowsize>
>         </property>
>         <property>
>                 <blahblah>somethingelse</blahblah>
>         </property>
>      <propertyset>
>      Would this allow you to have shared property stuff rather than
>      multiple property files ??
>      Is there any other advantages that anyone else can see ??

XML has a major advantage over other properties syntaxes: it's not flat.

If you do something like the above, you are probably driven by the xml
hype and you

 - loose readability
 - increase verbosity
 - increase parsing overhead
 - increase the size of your program
 - increase the software development costs

why? because flat files (.ini, .properties) do the job perfectly.

But if you need to do more complex things, like nested configurations,
then you _have_ to pay the XML price otherwise the complexity of your
flat files increases too much.

Look at java.properties files, it is possible to "structure" them like


pippo.directories="one, two, three"


.... (and so on)

where the XML equivalent is _much_ more readable

 <server name="pippo">
  <directory name="one">

So, like anything else, the use of XML depends on what you want to do.

My rule of thumb is: simple lists -> flat files, tree structured -> XML.

But you mileage may vary. :)

Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<stefano@apache.org>                             Friedrich Nietzsche
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------

View raw message