OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Configuration files

[ Lists Home | Date Index | Thread Index ]
  • From: "Eddie Sheffield" <eddie.sheffield@enterworks.com>
  • To: Peter Murray-Rust <peter@ursus.demon.co.uk>
  • Date: Fri, 26 Jun 1998 16:46:42 -0400

Peter Murray-Rust wrote:
> >Better here, I think, to use the simple keyword=value format
> >defined by java:
> >
> >parser.AElfred=com.microstar.xml.SAXDriver
> >parser.xp=com.jclark.xml.sax.Driver
> >preferred.parser=xp
> 
> If this is already parsed by Java I am happy to use it. But for structured
> things like menus we definitely want XML.

Yes, Java already parses property files in this format. Structured items
are a bit more trouble, and somewhat inflexible. But we use something
like this:

myapplet.menu.file=File
myapplet.menu.file.open=Open
myapplet.menu.file.save=Save
myapplet.menu.file.close=Close

This example is how we handle internationalization. Simple change the
values on the RHS to whatever label you want to appear on the item.

For this application I would tend to favor the idea of using a property
file for the bare-bones bootstrapping, perhaps using an entry to point
to a more thorough config file in XML. This way one can take advantage
of the way the Java class loader can "hunt down" the properties file in
a nice, platform independent way.

Incidentally, the property files can also be placed in packages by
placing the file in the appropriate directory and prepending the package
name when retrieving it. Note that there is no "package" keyword that
must be placed in the file, nor must the filename itself be changed. So
to have a property file com.mycompany.myclasses.myapplet I would create
a file called myapplet.properties and place it in the directory
com/mycompany/myclasses. Then when I requested the ResourceBundle called
com.mycompany.myclasses.myapplet it would automatically be located, just
like one of the class files making up my applet.

Eddie

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS