Database Reference
In-Depth Information
Web Communication Methods
Modern applications have a number of other options for delivering data to
a web browser for display. A slightly faster version of the refreshing web
page is to use the XMLHttpRequest (XHR) feature of most web browsers
to load the data into the browser rather than an image of the data. This
collection of technologies is also known by the name AJAX, which stands
for “Asynchronous JavaScript and XML.” It offers some improvements over
the old model by separating the data layer and the presentational layer. This
allows the application to tailor rendering of the data to the environment as
well as usually reducing the size of the data transferred.
Transferring data via XMLHttpRequest , like the page refresh, is inherently
built around polling. Data can only update as quickly as the polling
frequency, whichlimits howquickly newinformation canbedelivered tothe
front end. If events are relatively rare, such as with a notification system, a
large number of calls are also wasted to ensure that “no news is good news.”
As the need for more real-time communication has grown, a number of
“hacks” have been developed to make interactions between the browser and
the server seem more immediate, by using techniques such as long polling.
Collectively known as Comet, these methods now include true streaming to
the browser, allowing for the implementation of truly real-time interfaces.
There are twostandards currently in use: Server Sent Events (SSE)and Web
Sockets. SSE implements an HTTP-compatible protocol for unidirectional
streaming data from the server to the client. This is ideal for applications,
suchasadashboard,whichmostlytakeindata.Communication intheother
direction is handled by normal AJAX calls. Web Sockets, on the other hand,
implements a more complex protocol designed by bidirectional interaction
between the client and the server. This protocol is not HTTP compatible,
but it does have support from the three major desktop browsers (Internet
Explorer, Chrome, and Firefox) as well as most of the mobile browsers. SSE
are not available in Internet Explorer, but its HTTP compatibility means
that it can fall back to polling for browsers that do not support the interface
natively without extra server-side code.
Web-Rendering Methods
Bysendingthedatatotheclientside,applicationscanalsotakeadvantageof
the rendering components built into modern web browsers: Scalable Vector
Graphics (SVG) and Canvas drawing. Other drawing technologies—such as
Search WWH ::




Custom Search