Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9169699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:54:54+00:00 2026-06-17T15:54:54+00:00

I am designing a simple library that deals with properties files. I noticed that

  • 0

I am designing a simple library that deals with properties files.

I noticed that since JRE 1.5 the class Properties defines methods like:

public synchronized void loadFromXML(InputStream in)
public void storeToXML(OutputStream os, String comment)

I am questioning the fact that this is a real enhancement in the API of this class. Properties files have been, since JRE 1.5 text based files, and the newly introduced XML format is not adding anything to the functionalities, other than the possibility to use a different forma which is

  1. more verbose
  2. more complex (to understand, to change, to parse)
  3. more inefficient (it uses dom internally to parse into an hastable: it consumes more memory, it requires helper classes in the implementation, and most likely is also slower)
  4. more fragile (xml requires escaping of characters <>&”‘ while properties only need to escape backslashes, since it also supports Java backslash escaping)
  5. it breaks backward compatibility of the programs using it, since users running JDK 1.4 won’t be able to read xml properties. (ok, who cares…)

So I fail to understand the reason behind why engineers in Sun added this feature.

The question is:

Does anybody finds some advantage of using an XML-based properties files over a traditional text based one?

I need to evaluate this problem, since I don’t want to add a useless feature to my simple library that I cited before.

Did you ever used an XML-based properties file over a Java Properties file? And why?

Note: same question can be made for Log4J xml file format, but at least Log4J xml format adds nesting ability and some sort of syntax which has some meaning, and I do understand that. But with this xml format for properties, I don’t.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:54:54+00:00Added an answer on June 17, 2026 at 3:54 pm

    If staying within the Java environment, using a Java properties file works great. Even if you expect other programming languages to interact with your library, you’ll probably be ok with a ‘regular’ properties file. However, for hierarchical data, XML is the standard. The reason you may want to support this change, and possibly the reason why Sun included it, is that other programming languages have extensive libraries for parsing XML files for hierarchical data.

    The reason I’m answering is because I have actually used this feature before! But not for a great reason. In one program I’m working on now, I’ve found it easiest to keep a set of data in a properties object and I output the object to XML so that it can later be read by Python. At the moment, the data is further manipulated in a Python script and more children are added to the XML file. Without being able to output easily to XML, this would be a little more painful.
    If I had the time, I wouldn’t bother outputting to XML though. The main reason I’m using the Python code that takes in the XML is because somebody else wrote it and I’m temporarily using it until I have the time to reevaluate that section of my program and re-code it.

    So there’s a reason for using the XML! It isn’t a good one, but it’s a reason.
    I imagine there are other cases like this where having the properties outputted as an XML aids in compatibility with other languages, since most languages have a robust XML parsing library and it makes it easier to manipulate hierarchical data. And in scientific programming, it seems you rarely get the luxury of sticking to one language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm designing a simple messaging schema where a thread groups all messages that are
Right now I'm building a simple form and I'm designing it so that if
For a current project, we're designing a client desktop application that parses text files
I am designing a class library designed to solve a wide scope of problems.
I am designing a WPF application that uses a DLL with maybe 40 public
I'm writing a class library that provides convenient object-oriented frontends to the C API
Designing a simple HTML table that I am going to implement alternate-row coloring on...
I am designing a simple app from tutorials that I have seen, and I
I'm designing an iOS static library that will be used by other developers. This
I am designing a library that provides access to the Bug Tracker application our

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.