Yegge on Property Patterns
Steve Yegge has a great article on property patterns entitled The Universal Design Pattern. It’s long, but a worthy read. Not groundbreaking, but solid. It also covers an area of personal interest of my own.
Back when I was at Sony Electronics, I worked on a defect tracking system modeled as a typical transactional event system. Each time something was inspected, we’d record an event and a few default associated properties such as defect code, model type, etc. Eventually we expanded the system to include arbitrary, user-defined data which we called “additional information” (not very inspiring, I know). Our additional information model allowed for custom typed properties on events with a various optional rules and meta-properties (some values are only good for some models, for example). Additional information fields had associated user interface types, so they could be displayed as radio lists, select lists, buttons, grids, etc. Our data entry application had a dynamically generated user interface based on which additional information could be entered for the configured station, model, etc. All of this customization turned out to be one of the real advantages of our defect tracking system and part of the reason that it’s been able to morph and adjust over the years (it’s still in production today from what I understand).
When William and I first pondered the idea of launching a startup, one of our first product ideas was effectively a fancy user interface for a “property pattern” system. In the end, we decided it wasn’t the product we wanted to market, but I’ve still played around with that code. It’s a pet project of mine that I hope to open source one of these days when it’s “ready.”
Despite the length of Yegge’s article, there are a some omissions. For example, you can think of the property pattern as basically a tree of named hashmaps which might have some special meta-properties. It turns out this is effectively RDF. Consider the JavaScript from Yegge’s article:
var person = {
name: "Bob",
age: 20,
favorite_days: ['thursday', 'sunday']
}
You can think of this as a hashmap with the identifier “person”. You can also think of it as a series of triples:
| Subject | Predicate | Object |
|---|---|---|
| person | name | Bob |
| person | age | 20 |
| person | favorite_days | thursday, sunday |
This is interesting because Yegge mentions XML modeling when I think he means either document modeling or, more likely, hierarchal modeling. RDF takes hierarchal modeling a step further to graph modeling.
Finally, if you’re interested in this sort of thing, I’d also check out both CouchDB, Apache Jackrabbit and Atom Pub as three other systems that make heavy use of the property pattern.




§Commentary