A property list in computer programming is a list of key-value pairs that describe the specific attributes of a program or object. A key-value pair consists of a key, or the name of the attribute that is being referred to, and a value for that attribute. Property lists can be used to save objects to a file during the process of serialization or can be used to store information such as user preferences. They usually are human-readable and therefore can be platform-independent.
In modern computing, a property list that is going to be written to a file usually employs the extensible markup language (XML) to define the keys and values. XML is human-readable text that also can be read by any program, allowing the property list file to be moved between operating systems. Using XML has the added benefit of being supported by several programming libraries, which makes reading the list from a stream easier.
During data serialization, a property list is generated that contains key-value pairs that represent all of the state information in a given data object. The key refers to the name of the field being serialized, and the value is the actual state information being saved. Using mechanisms such as reflection, the property list can be read and the fields appropriately assigned to a new instance of the object class.
Some operating systems and computer languages have made property lists an integral part of their operating structure. These programs have taken the standard XML format of a property list and created proprietary implementations that allow the system to optimize the reading and writing of the lists. Although these still are property lists, they are not portable to other systems or programs unless they are specifically designed to read the modified format.
A property list is valuable in certain applications because it is human-readable. This has led to the development of specific programs that are used to edit property lists in a way that maintains the structure and makes it easier for the computer user. Certain operating systems even have built-in support for the editing and creation of property lists.
The structure and arguments of a property list that is created with XML can be defined with a block of code known as a document type definition (DTD). A DTD can help a program that is writing or reading a property list by defining the valid keys that can be used and the allowable ranges of the values assigned. This means that key-value pairs can be checked for correct syntax, and errors can be caught at the time of writing or reading before any invalid data has a chance to cause problems in a running program.