[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Configuration files

  • From: "Eddie Sheffield" <eddie.sheffield@e...>
  • To: Peter Murray-Rust <peter@u...>
  • Date: Fri, 26 Jun 1998 16:46:42 -0400

resourcebundle property files
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@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.