Chap 4 Ria
Chap 4 Ria
Chap 4 Ria
Syllabus: Characteristics of RIA, Introduction to AJAX: AJAX design basics, AJAX vs Traditional
Approach, Rich User Interface using Ajax, jQuery framework with AJAX.
RIA tools:
The list of current technologies that can be used to build modern RIAs is long. Here are
some of them:
1. AJAX
2. Adobe Flash, Flex and Adobe Integrated Runtime (AIR)
3. Microsoft Silverlight
4. Curl (an object-oriented language with embedded HTML markup)
Module 4: Rich Internet applications
5. Google Gears
6. OpenLaszlo and Webtop
7. Oracle WebCenter
Characteristics of RIA:
A number of key features differentiate RIAs from traditional Web applications.
An RIA can use a wider range of controls that allow greater efficiency and enhance the user
experience. In RIAs, for example, users can interact directly with page elements through editing
or drag-and-drop tools. They can also do things like pan across a map or other image.
2. Partial-page updating: Standard HTML-based Web pages are loaded once. If you update
something on a page, the change must be sent back to the server, which makes the changes
and then resends the entire page. There's no other way to do it with HTTP and HTML. With
traditional Web-based apps, network connectivity issues, processing limitations and other
problems require users to wait while the entire page reloads. Even with broadband
connections, wait times can be long and disruptive.
3. Better feedback: Because of their ability to change parts of pages without reloading, RIAs can
provide the user with fast and accurate feedback, real-time confirmation of actions and choices,
and informative and detailed error messages.
4. Consistency of look and feel: With RIA tools, the user interface and experience with different
browsers and operating systems can be more carefully controlled and made consistent.
5. Offline use: When connectivity is unavailable, it might still be possible to use an RIA if the
app is designed to retain its state locally on the client machine.
6. Performance impact: Depending on the application and network characteristics, RIAs can
often perform better than traditional apps. In particular, applications that avoid round trips to
the server by processing locally on the client are likely to be noticeably faster. Offloading such
processing to the client machines can also improve server performance. The downside is that
small, embedded and mobile devices -- which are increasingly common -- may not have the
resources necessary to use such apps.
Module 4: Rich Internet applications
7. Security: RIAs should be as secure as any other web application, and the framework should
be well equipped to enforce limitations appropriately when the user lacks the required
privileges, especially when running within a constrained environment such as a sandbox.
8. Advanced Communication: Sophisticated communications with supporting servers through
optimized network protocols can considerably enhance the user experience.
9. Rapid Development: An RIA Framework should facilitate rapid development of a rich user
experience through its easy-to-use interfaces in ways that help developers.
10. Improved Features: RIA allow programmers to embed various functionalities in graphics-
based web pages that look fascinating and engaging like desktop applications. RIA provide
complex application screens on which various mixed media, including different fonts, vector
graphic and bitmap files online conferencing etc. are paused by using different modern
development tools.
Advantages of RIA:
The benefits and advantages of the RIA are:
1. Remotely accessed application: The basic principle of the RIA is the ability to have any
new user connect and run the application from any location as long as they are
connected to the network.
2. Full interactive experience: Unlike Web applications that provide page-by-page
interaction and feedback, the RIA provides a full interactive end-user experience.
3. Minimal Total Cost of Ownership (TCO):
There is no need for application-specific setups to access and run a RIA.
There is no need to manage the end-user's machine to accommodate application
maintenance.
There is no need to install client-side software, such as Database-client and
special printer drivers.
4. Integrated Form Editor: The user interface design is an integral part of the uniPaaS
Studio.
5. A Comprehensive Solution: A comprehensive end-to-end solution facilitating full
interactive distributed clients and a centralized managed server.
6. A Single Unified IDE & Paradigm: The Rich Client is supported by a single and unified IDE
and development paradigm for defining server-side and client-side logic along with the
user interface design.
7. Automatic Logic Partitioning: The Rich Client deployment modules facilitate optimized
automatic logic partitioning between client and server.
8. Performance-Aware Development: The Rich Client Studio is a performance-aware
platform for developing response-optimized applications.
Module 4: Rich Internet applications
9. Native Look & Feel – The Rich Client provides an automatic reflection of the native look
and feel of the selected client machine.
10. Browser free solution – The Rich Client is independent of browser vendors and browser
versions.
11. Local Resources Activation – The Rich Client supports various activities that can be
executed on the client side. For example:
OS command
File manipulation
OS environment manipulation
AJAX Introduction
AJAX is a developer's dream, because it allows:
What is AJAX?
AJAX = Asynchronous JavaScript And XML.
AJAX is a misleading name. AJAX applications might use XML to transport data,
but it is equally common to transport data as plain text or JSON text.
Module 4: Rich Internet applications
JavaScript
Loosely typed scripting language.
Module 4: Rich Internet applications
DOM
API for accessing and manipulating structured documents.
Represents the structure of XML and HTML documents.
CSS
Allows for a clear separation of the presentation style from the content and may be
changed programmatically by JavaScript
XMLHttpRequest
JavaScript object that performs asynchronous interaction with the server.
Here is a list of some famous web applications that make use of AJAX.
Google Maps
A user can drag an entire map by using the mouse, rather than clicking on a button.
https://maps.google.com/
Google Suggest
As you type, Google offers suggestions. Use the arrow keys to navigate the results.
https://www.google.com/webhp?complete=1&hl=en
Gmail
Gmail is a webmail built on the idea that emails can be more intuitive, efficient, and
useful.
https://gmail.com/
As you can see in the above example, XMLHttpRequest object plays a important role.
1. User sends a request from the UI and a javascript call goes to XMLHttpRequest object.
2. HTTP Request is sent to the server by XMLHttpRequest object.
3. Server interacts with the database using JSP, PHP, Servlet, ASP.net etc.
4. Data is retrieved.
5. Server sends XML data or JSON data to the XMLHttpRequest callback function.
6. HTML and CSS data is displayed on the browser.
try {
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
response.getWriter().write("<valid>true</valid>");
} else {
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("<valid>false</valid>");
}
}
function processRequest() {
if (req.readyState == 4) {
if (req.status == 200) {
var message = ...;
...
}
JavaScript may now be used to modify the element's attributes; modify the
element's style properties; or add, remove, or modify the child elements. Here is
an example −
<script type = "text/javascript">
<!--
function setMessageUsingDOM(message) {
var userMessageElement = document.getElementById("userIdMessage");
var messageText;
if (message == "false") {
userMessageElement.style.color = "red";
messageText = "Invalid User Id";
} else {
Module 4: Rich Internet applications
userMessageElement.style.color = "green";
messageText = "Valid User Id";
}
<body>
<div id = "userIdMessage"><div>
</body>
If you have understood the above-mentioned seven steps, then you are almost done
with AJAX. In the next chapter, we will see XMLHttpRequest object in more detail.