At my day job I’ve been working on integration between different systems through creating widgets. There are a few different avenues to take. My metric was the preceived integration with the site, so using the DOM ended up as the best option.

The DOM actually makes for a pretty decent medium for communication. If you force widgets to truly be written in the DOM instead of an iframe, every widget has access to those values that are in the DOM. Sure, you could also used namespaced JavaScript to grab values from other widgets, but then you require those widget’s dependencies. When the DOM is used, you can mock the information the other widgets provide. This allows you the option of rendering the widget on the server or via Javascript. This also allows you to specify initialization details via simple HTML instead of including extra JavaScript.

Likewise, by using the DOM, you can integrate your widget throughout the page. Things like CSS can apply directly to the widget HTML. Also, a widget may not even insert visible HTML in the dom. For example, an annotation widget might look through a DOM element to attach small balloons for notes that others left. None of this is trivial, but assuming the cross domain security issues can be dealt with reasonably, utilizing the DOM as something of a data store has its advantages.

Where this concept becomes even more powerful is in light of the Semantic Web. The Simile project provides a wealth of examples on how to take Semantic Data and present it in a useful way. Eric Miller describes this as creating an experience, which conveys the true value of Semantic Data. The idea of using the DOM in my widgets is to support a certain user experience where different services are used in unison to integrate the value of the systems. As the Semantic Web continues to evolve, the user experiences are where the biggest gains will be seen.