10.3. Preferences

To be able to store and retrieve preferences persistently is a common requirement for many applications. It is also highly desirable to use a more expressive hierarchical structure than a flat property file. A treelike hierarchy can organize categories of attributes naturally. For instance, if we were to manage a user's Netscape preferences, we would have a tree with the layout presented in Figure 10.2.

Figure 10.2. A preference tree

Each node in the tree is named with a path similar to that of a file system. For example, /Mail/Identity refers the node that contains Joe's name and e-mail address. Different users usually have different ...

Get Programming Open Service Gateways with Java Embedded Server™ Technology now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.