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 sets of preferences. Therefore, each user can have her own preference tree, not unlike the multiple user profile feature of the Netscape browser. In addition, a system preference tree is available for system attributes. Modeled after the Preferences API (http://java.sun.com/aboutJava/communityprocess/review/jsr010) being standardized in the Java community process, such a service is in the works.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.27.74