Revamped APIs for Hub 2.0
The Interoperability Working Group has completed a major redesign of the Managed Hub feature within OpenAjax Hub 2.0. The redesign effort, which started at alliance’s face-to-face meeting in October 2008, reflects implementation experience gained during the 2008 InteropFest.
The biggest change is from a plugin-oriented approach to a class hierarchy approach. The new approach is both simpler and more easily extensible than the previous approach.
Here are some characteristics of the new Managed Hub APIs:
- Revised terminology – The new APIs are centered on two notions, Containers and HubClients. A Container is a manager-side object that wraps a particular client. Each container must supply a companion HubClient, which is a client-side object that wraps the client’s runtime logic. The Container’s manager side object communicates with its companion HubClient through private, container-specific protocols. There are two built-in Containers, the IframeContainer (for untrusted clients) and the InlineContainer (for trusted clients), which match up with the two built-in HubClients, the IframeHubClient and the InlineHubClient.
- Extensible class hierarchy approach – Instead of the previous notion of “plug-in providers”, the new APIs provide an extensible class hierarchy that allow for “Custom Containers”. A Custom Container must implement the base interfaces for Container and HubClient.
- Scoped callbacks – The new APIs provide the ability to set the scope (i.e., the value of the “this” variable) for all callback functions.
- Completeness – The new APIs reflect implementation experience regarding the various utility APIs that developers will need. The various object constructors provide a rich set of configuration parameters, and the APIs provide the various getter functions that an application developer will need at runtime.