Introduction To SL4B
StreamLink for Browsers (SL4B) provides an object oriented JavaScript API that enables the
creation of dynamic web applications within a browser. It allows a web developer to create a web
page that has bi-directional communication with a server, without the need to reload the page or
write their own streaming or polling mechanism to get required data from the server.
SL4B provides a subscription based API that can communicate with a Caplin Liberator, using
the Real Time Text Protocol (RTTP). It allows the web page to subscribe and unsubscribe to the
objects available from the Liberator, to receive notifications of updates to these objects, to
create and delete objects, and to contribute data to existing objects.
- Dynamic Subscriptions - A web page can subscribe and unsubscribe to data at runtime.
It is not restricted to the data set it initially subscribed to when it was first
loaded.
- Bi-directional Communication - In addition to subscribing to data, the client can
create and delete objects on the Liberator, and can also contribute data to an existing
object. Depending on the Liberator's configuration, data contributed to an object can be
passed onto a DataSource.
- Resilient Connection - SL4B continuously monitors the clients connection with the
Liberator and will automatically attempt to reconnect if the connection is lost. Connection
state events are raised by the library and can be monitored by a JavaScript listener
object.
- Cross Browser Support - SL4B works in both IE 5.5+ and Firefox 1.0+ on Windows and
Firefox 1.0+ on Linux. A browser adapter layer has been used to normalise the differences
between the various browsers. Further browser/platform support will be added in a later
release.
- AJAX Streaming - SL4B supports streaming using AJAX technologies
(
XMLHttpRequest). This enhancement eliminates the Java-JavaScript interaction
issues experienced in some Sun Java Virtual Machines (JVM), which currently make Java an
unreliable solution.
- Shared Configuration File - Configuration attributes can be shared between multiple
web pages. A common configuration file can be specified using the
configurationfile script tag attribute.
- RTML/RTSL Compatibility Layer - A compatability layer for RTML and RTSL has been
included, which allows most web pages written using either of these two legacy products to
work without modification. Please check the
Backwards Compatibility - Known
Issues section of the API documentation for more information.
- SL4B/RTML/RTSL In One Frame - SL4B, RTML and RTSL can now be used within the same
frame. The most suitable technology can be used within one section of the frame (e.g.
displaying some record data with RTML) whilst another section uses a different
one (e.g. displaying news headlines using RTSL). Previously RTML and RTSL were mutually
exclusive.
Back to contents
SL4B is designed to have a modular, loosely coupled, architecture. Logically separate parts
of the system are kept apart from each other using well defined interfaces. This allows alternative
implemenations of a particular interface to be switched in without impacting components dependant
on that interface - they are decoupled. The best example of one of these interfaces is the
SL4B_AbstractRttpProvider, which
is explained in more detail in the RTTP
Provider section of the SL4B API document.
The other main design feature of SL4B is its use of JavaScript classes and objects. An example
of this is SL4B_AbstractSubscriber,
which should be subclassed by a class that is interested in subscribing to specific data sets and
only receiving updates for objects within those data sets. This functionality is covered in more
detail in the Subscriber section of the
SL4B API document.
Back to contents
Further information about SL4B can be found from the following links.
- API Documentation - comprehensive JsDoc for the SL4B library
- Examples - example pages using SL4B that will work
with a standard Liberator installation connected to a
demosrc
- Configuration Attributes - a list of all
the attributes that can be used to configure SL4B
- Connection Failover - explains how the client
side connection failover functionality works, how it is configured, and the various failover
algorithms that can be applied
- Frequently Asked Questions - a FAQ providing anwsers to common
issues experienced with SL4B
- Known Issues - a list of known issues with this version
of SL4B
Back to contents