Jon Udell has suggested that what we need is an architecture of intermediation. In that piece he’s seems to be mostly talking about the need for toolkits that make it easy to build this kind of intermediary. I agree with Simon Willison that Greasemonkey is a pretty powerful way of doing this, especially after looking at Matt Biddulph’s web site mash-up example.
What interests me are the design patterns that support that architecture of intermediation. Lots of people are writing bookmarklets, AJAX sites and Greasemonkey scripts, but I don’t yet see a lot of consolidation around the basic techniques, what tasks they solve, their relative strengths and weaknesses, etc.
Discovering design patterns involves a little digging, so lets see if a bit of classification might help.
Consider three basic axes: data source, action, and trigger. Or: where does the intermediary get its data, and how is that data used, and what triggers the intermediary?
On the “data source” axis we have:
- The URL, including both path and query string
- Embedded metadata, e.g. HEAD of an HTML document
- The document body, extracted either from semantic markup, or just brute-force scraped from the text
- An external service, invoked asynchronously
- A combination of these
On the “action” axis we have:
- Redirect, e.g. take the user to another site
- Annotate, e.g. add markup or data to the current page
- Generate Interface, e.g. generate and populate an HTML form to prompt interactions with further services
On the “trigger” axis we have:
- User initiated, e.g. activating a bookmarklet
- Event driven, e.g. when a document is loaded
By way of examples, Udell’s LibraryLookup bookmarklet would be classified as: Data 1, Action 1, Trigger 1.
Biddulph’s BBC3+del.icio.us mashup would be: Data 4(+1), Action 2, Trigger 2.
This experimental delicious posting tool would be classified as Data 1, Action 3, Trigger 1. You get the general idea.
It’s not a great step from classifying intermediaries in this fashion, to documenting patterns using the traditional form, covering naming (an important step), motivation and general design. From there we can start to share techniques and communicate more effectively about how to build various kind of intermediaries.