Welcome!

Machine Learning Authors: Pat Romanski, Liz McMillan, Yeshim Deniz, Elizabeth White, Zakia Bouachraoui

Related Topics: Machine Learning

Machine Learning : Article

Introducing OpenAjax Hub 1.0

Providing key integration services

The OpenAjax Alliance is an organization of leading vendors, open source projects, and companies using AJAX that are dedicated to the successful adoption of open and interoperable AJAX-based Web technologies. This article introduces the alliance's first major technical product, OpenAjax Hub 1.0.

The OpenAjax Hub is a set of standard JavaScript that, when included with an AJAX-powered Web application, promotes the ability for multiple AJAX toolkits to work together on the same page.

The central feature of the OpenAjax Hub is its publish/subscribe event manager (the "pub/sub manager"), which enables loose assembly and integration of AJAX components. With the pub/sub manager, one AJAX component can publish (i.e., broadcast) an event to which other AJAX components can subscribe, thereby allowing these components to communicate with each other through the Hub, which acts as an intermediary message bus.

The umbrella use case for the OpenAjax Hub is the set of scenarios in which an AJAX developer needs to deploy a single application that uses multiple AJAX libraries simultaneously. Here are some specific scenarios:
•  Your favorite AJAX library does not address all requirements: In some cases, an AJAX developer might choose to build the majority of his applications using one particular AJAX library, but discovers that the library lacks a particular feature that he needs, and therefore would like to integrate a component from a different AJAX library. In other cases, most of the applications might be (non- AJAX) DHTML, but the developer would like to incorporate two components of AJAX technology into the application, where the two components come from different AJAX libraries.
•  Mashups: A developer (or end user) is likely to find that the different components participating in the mashup are based on different AJAX libraries.
•  Portals: Just as with mashups, it is likely that different AJAX-powered portlets will be based on different AJAX libraries.
•  Preference for a loosely coupled application architecture: The Hub's pub/sub engine provides an industry-standard approach for a simple, loosely coupled AJAX component integration facility within a Web page. Because the Hub's pub/sub engine is independent of particular toolkits, implementing to the Hub can sometimes provide modularization benefits that might allow for modular replacement of some technologies used within a given Web page.

The Hub's Publish/Subscribe Manager
The Hub's pub/sub manager allows one part of a mashup to broadcast an event to which other application components subscribe. Let's illustrate with an example.

Suppose we have a business intelligence application that uses the following AJAX runtime libraries:

  • UTILS.js: Provides highly useful extensions to the browser's JavaScript environment, such as XMLHttpRequestAPIs
  • CALENDAR.js: Provides a calendar widget
  • CHARTS.js: Provides a charting widget
  • DATAGRID.js: Provides an interactive data grid widget
Let's assume that the application has a single calendar widget that allows the user to pick a particular date or date range. Along with the calendar, there are various data visualization components in the form of chart widgets (such as a variety of bar charts for daily status, weekly status, monthly status, and yearly status) and data grid widgets (such as selectors for regional data versus national data, both with user-selected columns of interest). Whenever a new date or date range is selected in the calendar widget, the various user-specified visualization components - that is, the charts and/or data grid widgets - need to be updated.

One way to implement this application is to load the JavaScript for the OpenAjax Hub before loading the other AJAX libraries. For example:

<html>
   <head>
      ...
      <script type="text/javascript" src="OpenAjax.js"/>
      <script type="text/javascript" src="UTILS.js"/>
      <script type="text/javascript" src="CALENDAR.js"/>
      <script type="text/javascript" src="CHARTS.js"/>
      <script type="text/javascript" src="DATAGRID.js"/>
      ...
   </head>
   ...

(Note: Some AJAX runtimes will include the OpenAjax Hub as part of their standard distribution, in which case, as long as the given AJAX runtime's JavaScript is loaded before other OpenAjax-compatible runtimes are loaded, it might not be necessary to include a separate <script> element for OpenAjax.js.)

To make the application work, the developer registers a callback function that is invoked whenever the user selects a new date in the calendar widget. This callback function then broadcasts the new date event using the OpenAjax Hub's publish() function:

<script type="text/javascript">
    // Somewhere in earlier JavaScript code, you need
    // to invoke the calendar widget's APIs to
    // register MyCalendarCallback as the callback
    // function for when a new date is selected
    ...
    function MyCalendarCallback(...) {
    // Publish the "myapp.newdata" event via
    // the OpenAjax Hub.
    OpenAjax.hub.publish("myapp.newdate", newdate);
    }
    ...
</script>


More Stories By Jon Ferraiolo

Jon Ferraiolo is an employee of IBM within its Emerging Internet Technologies group. Jon is devoted exclusively to OpenAjax Alliance, where he manages operations and leads many activities.Before joining IBM in 2006, Jon worked at Adobe for 13 years where he was an architect, engineering manager and product manager.

Jon has been a speaker at every AJAXWorld conference since October 2006, and has spoken at dozens of other industry conferences in the past couple of years. AJAXWorld magazine has published 6 or 7 articles Jon has submitted over the past couple of years.

Comments (0)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.


CloudEXPO Stories
Every organization is facing their own Digital Transformation as they attempt to stay ahead of the competition, or worse, just keep up. Each new opportunity, whether embracing machine learning, IoT, or a cloud migration, seems to bring new development, deployment, and management models. The results are more diverse and federated computing models than any time in our history.
On-premise or off, you have powerful tools available to maximize the value of your infrastructure and you demand more visibility and operational control. Fortunately, data center management tools keep a vigil on memory contestation, power, thermal consumption, server health, and utilization, allowing better control no matter your cloud's shape. In this session, learn how Intel software tools enable real-time monitoring and precise management to lower operational costs and optimize infrastructure for today even as you're forecasting for tomorrow.
"Calligo is a cloud service provider with data privacy at the heart of what we do. We are a typical Infrastructure as a Service cloud provider but it's been designed around data privacy," explained Julian Box, CEO and co-founder of Calligo, in this SYS-CON.tv interview at 21st Cloud Expo, held Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA.
Isomorphic Software is the global leader in high-end, web-based business applications. We develop, market, and support the SmartClient & Smart GWT HTML5/Ajax platform, combining the productivity and performance of traditional desktop software with the simplicity and reach of the open web. With staff in 10 timezones, Isomorphic provides a global network of services related to our technology, with offerings ranging from turnkey application development to SLA-backed enterprise support. Leading global enterprises use Isomorphic technology to reduce costs and improve productivity, developing & deploying sophisticated business applications with unprecedented ease and simplicity.
While a hybrid cloud can ease that transition, designing and deploy that hybrid cloud still offers challenges for organizations concerned about lack of available cloud skillsets within their organization. Managed service providers offer a unique opportunity to fill those gaps and get organizations of all sizes on a hybrid cloud that meets their comfort level, while delivering enhanced benefits for cost, efficiency, agility, mobility, and elasticity.