Patterns of Intermediation

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:

  1. The URL, including both path and query string
  2. Embedded metadata, e.g. HEAD of an HTML document
  3. The document body, extracted either from semantic markup, or just brute-force scraped from the text
  4. An external service, invoked asynchronously
  5. A combination of these

On the “action” axis we have:

  1. Redirect, e.g. take the user to another site
  2. Annotate, e.g. add markup or data to the current page
  3. Generate Interface, e.g. generate and populate an HTML form to prompt interactions with further services

On the “trigger” axis we have:

  1. User initiated, e.g. activating a bookmarklet
  2. 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 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.