Science Service Bus Translators


When you define a new message type, you can also define translators which transform data from your message type to or from some other data type. When you register a translator with the server, the server will automatically invoke it to enable communication between otherwise incompatible agents. If an agent registers which doesn’t understand your message type but understands some other message type for which a translator is defined, the SSB will arrange to automatically translate the data between the two types, even though each agent doesn’t understand the other agent’s data format.

Typical Uses

For example, suppose one applications is written in JavaScript and expects all its data to be in JSON. Another application is written in Java, and doesn’t know anything about JSON. The author of one of these applications might provide a translator from JSON to Java object and from Java object to JSON. The server will notice that the applications could communicate with the aid of the translator, and will automatically translate data between Java object and JSON strings.

Another use of a translator is to support new versions of an existing format. For example, suppose somebody decided that the DataMatrix class needed some new fields. He could define a DataMatrixExtended class which provided the new fields. Then, he could allow applications to use either the old type or the extended type by defining a translator that translated from original to extended by populating the new fields with default data.

There is also no reason that the translated data needs to exactly mirror the original data. Another interesting idea would be to provide a translator which translated a URL into data. The sender would send a URL, and the translator would retrieve the data from the URL and forward it to the recipient. In this case, the input to the translator would be only the URL and the output from the translator would be a potentially large block of data. This type of translator would free clients from having to know how to retrieve data from various web sites, centralizing this functionality in the server.

ssbtranslators.txt · Last modified: 2009/01/03 06:33 by
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki