Understanding AJAX Applications and ASP.NET "Atlas"
=====================================
Introduction
AJAX (Asynchronous JavaScript and XML) describes a cross-platform, client
-centric approach to developing Web applications. In AJAX, developers use
client scripts to make asynchronous calls to Web server applications using
an XML-based protocol. The new ASP.NET technology code-named "Atlas" is
a package of Microsoft technologies that applies and extends the AJAX approach
. This topic describes the Web application development issues that AJAX addresses
, explains the basic concepts of AJAX, and introduces ASP.NET "Atlas" as
a significant evolution and enhancement of the AJAX approach.
=====================================
Development Issues Addressed by AJAX
Users and developers can experience limitations with the traditional request
-response model used by most Web applications. Because Web applications are
stateless, every time the data or the user interface (UI) in a Web page
needs to change, the entire page must be posted back to the server for updates
- that is, the page must make a round trip. Numerous round trips, especially
when large quantities of data are passed between client and server, can
result in users experiencing long waits.
Another issue is that the HTML controls in Web browsers have limited capabilitie
s
compared with those available in a rich UI, such as in desktop applications
Many browsers include enhancements to HTML controls, but these enhancements
are often implemented in browser-specific ways. Therefore, to take advantage
of HTML control enhancements and create a rich UI, Web developers must create
browser-specific versions of their applications. This is complex, so many
developers avoid building client-based features into their Web applications
As a consequence, users can find Web applications less appealing than other
types of applications.
The AJAX approach addresses both of these development issues.
===========================
AJAX Technical Concepts
AJAX is built on a core set of concepts: asynchronous calls with XML data
transfer and extensive use of client script.
In AJAX, developers can call Web services asynchronously from client scripts
using XMLHTTP, a protocol used to package information as XML data and then
transfer it on the network. Most browsers implement an XMLHTTP class that
is used to create a proxy object that makes the remote call and sends and
receives the data. With asynchronous calls, the data and UI on a Web page
can be updated without requiring a round trip. The result is less data transferr
ed
and better application performance. Asynchronous calls also make the application
more responsive, because users can continue working in the browser while
the call is in progress.
Another aspect of AJAX is the extensive use of client-side script, specifically
JavaScript (ECMAScript). JavaScript is used to make remote procedure calls
, to perform application processing on the client (as opposed to handling
it on the server), and to create enhanced UI features.
AJAX solutions use JavaScript together with several other client technologies
, including the following:
" The browser's Document Object Model (DOM), which exposes the elements on
an HTML page as a standard set of objects (document, window, and so on)
that can be manipulated programmatically.
" Dynamic HTML (DHTML), which extends HTML with facilities for reacting to
user input on the page in client script, without requiring a round trip.
" Behaviors, which are a way of programmatically packaging UI actions (such
as drag and drop) that can then be associated with page elements.
" Components, which are custom JavaScript objects that provide extensive
client-side UI features.
JavaScript in combination with these client-side technologies enables developers
to create a UI with features that can rival those in desktop applications
. Two examples of AJAX-style applications are the Microsoft Virtual Earth
site and the Microsoft Outlook Web Access e-mail client. Both applications
exhibit the extensive UI and high performance that are typical for applications
built with this approach.
However, using these technologies to create AJAX applications is complex.
Until recently developers have had to manually create the event handling
, messaging, and other details need to create an extensive UI. Furthermore
, because JavaScript is not an object-oriented programming (OOP) language
, it does not have strong typing, namespaces, exception handling, and other
OOP features. Developers have often had to write their own infrastructure
code for features that are built into other languages.
========================================
ASP.NET "Atlas" Provides a New Approach
ASP.NET "Atlas" is Microsoft's answer for how you can harness the power of
AJAX applications. ASP.NET "Atlas" provides all the capabilities of AJAX
, but extends the concept and significantly reduces the complexity of AJAX
development.
On the client side, "Atlas" provides an extensive set of script libraries
that provide these features:
" Object-oriented development. The client libraries add object-oriented fea
tures
to JavaScript, such as a type system, data types, namespaces, events, and
so on. These features give you a familiar programming model and enable you
to write higher quality, maintainable, and reusable code.
" Browser compatibility. The libraries handle browser compatibility issues
automatically, eliminating the need to write browser-specific scripts.
" Behaviors and client components. The libraries include commonly used beha
viors
, including auto-completion, drag and drop, popups, and mouse hovering. They
also add components that can be bound to data, which simplifies creating
data-driven business applications.
" Code for handling remote procedure calls. The libraries manage the comple
xity
of making asynchronous calls over XMLHTTP, reducing a call to just a few
lines of scripting code.
" Declarative programming model. The libraries enable you to create "Atlas
" components using declarative syntax, similar to how you create ASP.NET
server controls.
"Atlas" also includes server components that provide an extensive set of
features on the server that complement the "Atlas" client script libraries
. The "Atlas" server components include the following:
" Web server controls. These ASP.NET server controls emit client script to
use "Atlas" features. These controls are useful if you already know server
-side development well or if you do not create "Atlas" client scripts manually
.
" Web services. These are ASP.NET Web services, such as ASP.NET profiles,
that can add useful server-side features to an "Atlas" application.
To learn more about the "Atlas" features and architecture, see ASP.NET "Atlas
" Overview. To work with the "Atlas" preview, try the Hands-on Lab exercises
or the walkthrough available on the "Atlas" PDC documentation page.
See Also
ASP.NET "Atlas" Overview
"Atlas" PDC Documentation
浙公网安备 33010602011771号