Article Preview
Buy Now
FEATURE
Your Preferences in Keys
Managing preferences as key/value pairs
Issue: 9.4 (May/June 2011)
Author: JC Cruz
Author Bio: JC is a freelance engineering writer from North Vancouver, British Columbia. He frequently contributes articles to MacTech and REALbasic Developer. He also wrote for the now defunct Python Magazine, and is now working on a database e-book. Away from the writing pile, JC spends quality time with his foster nephew, as a proper uncle should. He can be reached at anarakisware-at-gmail-dot-com.
Article Description: No description available.
Article Length (in bytes): 65,355
Starting Page Number: 49
Article Number: 9408
Resource File(s):
9408.zip Updated: 2011-05-02 17:49:01
Related Web Link(s):
http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/PropertyLists/PropertyLists.pdf
http://docs.realsoftware.com/index.php/Dictionary
http://en.wikipedia.org/wiki/Associative_array
http://en.wikipedia.org/wiki/INI_file
http://en.wikipedia.org/wiki/Property_list
http://en.wikipedia.org/wiki/YAML
http://www.apple.com/DTDs/PropertyList-1.0.dtd
Excerpt of article text...
Rare is the software product that ships as is. In fact, most products permit users to adjust their behaviours, to make changes that bests suit each user's work habits.
So today we take a good look at how we manage a user's settings. We will study how to render these settings as key/value pairs, and how to store them to an external file. We will examine four types of file formats and the benefits they offer. We will even study the
Dictionary
class, which will serve as our data model.When Users Customize
The modern software applications uses
settings to prepare and direct some of its processes. These settings are held in a central buffer and are written to an external file when the product ends its session. Some settings are made available to the current session. Others are used to prepare the next session.Most applications provide a dedicated window to view and alter its settings. This window, called the
preferences window may be modal, requiring immediate attention. Or it may be non-modal, allowing users to continue interacting with the product. Some applications dispense with the window, preferring instead for users to alter the settings file directly.
...End of Excerpt. Please purchase the magazine to read the full article.