- It has the basic methods of a Map (using Java's terminology): get, put, has, and remove.
- Keys are generally strings.
- It has a pointer to a parent property list so properties can be inherited and overridden. In particular, certain operations, such as get, are applied on a child, but if the property is not found there, it is applied to the parent.
- Reading a property returns the first value encountered for that property, from the child if it exists, otherwise from its ancestor.
- Writing (and deleting) a property on the child only changes the property list for that child. When deleting a property that is inherited, it must be flagged in the child as deleted, not actually deleted. Otherwise, all siblings and the parent will have the property deleted.
- Properties can have meta-properties. Common ones include information governing types and access control (such as "read-only").
Sunday, November 23, 2008
Steve Yegge's Property List Pattern Summary
Steve Yegge has written an article entitled The Universal Design Pattern in which he describes in detail the Property List Pattern [1]. The key design elements of this pattern (as he describes them) are:
Labels:
Data Structure,
Design,
Design Pattern