In Chapter 10 of Volume I, you have seen the use of property files to describe the configuration of a program. A property file contains a set of name/value pairs, such as
fontname=Times Roman fontsize=12 windowsize=400 200 color=0 50 100
You can use the
Properties class to read in such a file with a single method call. That’s a nice feature, but it doesn’t really go far enough. In many cases, the information you want to describe has more structure than the property file format can comfortably handle. Consider the
fontname/fontsize entries in the example. It would be more object-oriented to have a single entry:
font=Times Roman 12
But then, parsing the font description gets ugly as you have to figure out when the font name ...