Simplify client-side programming with Atlas
Wednesday, May 10, 2006 01:09 PM
Microsoft has developed its own approach to AJAX development called Atlas, which promises browser ubiquity as well as tight, albeit optional, ASP.NET integration. In this column, we survey the Atlas architecture to get a better understanding of how you may use it in your development work.
What is Atlas?
Microsoft says Atlas' goal is the integration of client
scripting with ASP.NET on the server to provide a comprehensive development
platform.
There are two parts of the Atlas platform: client and server. On the client side, the following features are included:
- A consistent object-oriented JavaScript API. Its object-oriented design will be familiar to experienced .NET developers.
- Automatic browser compatibility. In theory, no special coding is required for applications to run in multiple browsers.
- Client-script APIs and components that support rich UI features, such as drag-and-drop behavior. You can add these features to HTML controls with little or no coding.
- A declarative model for client development that is similar to the declarative syntax for ASP.NET server controls.
Atlas extends the AJAX approach further by integrating with the server tier. This includes taking advantage of Web services, as well as ASP.NET Web server controls automatically, and generating the requisite Atlas client script. Finally, the Visual Studio IDE may be utilized to streamline the development of Atlas-based applications.
JavaScript is the key
A key goal of Atlas is the simplification of client-side
programming. JavaScript has evolved into the standard for Web client
development; however, it often provides a roadblock with another language to
master to build robust applications. Atlas contains a set of JavaScript
libraries that provide everything necessary to create Web client-based applications.
Microsoft describes the libraries as a subset of the ASP.NET architecture. This
approach hides much of the complexity from the developer.
The API makes it easy for developers to utilize the script libraries, which utilize a layered approach to Web client-side development with the following layers or services:
- Browser compatibility layer: It provides compatibility across most browsers and eliminates the need to write browser-specific scripts.
- Core services: This includes JavaScript extensions like classes, namespaces, event handling, inheritance, data types, and object serialization. This brings the familiar .NET development techniques to the Web client.
- Base class library: A base library that includes base components like string builders, debuggers, timers, and tracing.
- Networking layer: This facilitates communication via HTTP and the AJAX approach. It manages asynchronous remote method calls and hides the complexity by reducing calls to just a few lines of scripting code.
- User Interface layer: This includes client capabilities like behaviors, user interface components, and data binding.
- Controls layer: These Atlas-specific controls for Web client development may be data-bound, scripted, bound to Atlas behaviors (provided by the user interface layer) such as drag and drop, and so forth. These controls include an auto-completion text box, a data-bound control, and navigation controls.
- Declarative programming: A powerful declarative programming model facilitating the creation of custom Atlas components. It follows the same approach used for developing ASP.NET server controls.
On the server side, there are Web services that provide ASP.NET features like security via profiles, roles, and membership, as well as personalization and globalization elements. Atlas includes numerous controls that resemble ASP.NET server controls with these controls emitting all of the necessary client-side Atlas JavaScript code. In addition, the Atlas server controls utilize JavaScript to produce Atlas behaviors.
Download the Atlas setup app
The Atlas platform is a comprehensive development
environment with plenty of features to learn, which can be a bit overwhelming
to new developers. A good way to get a better idea of the ins and outs of Atlas
is to dive into some sample code or develop your own. The
first step is downloading
and running the Atlas setup files.
Atlas installation is as simple as downloading and running the windows installer (.msi) file. You are asked if you want to install Atlas support on your IIS instance (if available), as well as a Visual Studio template. By default, Atlas is installed in the following directory:
C:\Program Files\Microsoft ASP.NET\Atlas\
v2.0.50727\Atlas
The Atlas assembly is named Microsoft.Web.Atlas.dll. It includes client script files that comprise the Atlas client-side script libraries. If you are using Visual Studio and you have installed the templates, the Atlas components will be available via IntelliSense in the IDE client.
Let's take a look at the Atlas platform in action by reworking the AJAX example used in last week's article. The script in Listing A does just that. It allows the user to enter text via a text box and click a link to display matching data from the standard SQL Server Northwind database (company table).
A few notes on the page:
- The Atlas ScriptManager control drives the Atlas processes. It provides functionality to both the page developer and the control developer, and it orchestrates partial refreshes, incremental updates, and so forth. Its EnablePartialRendering attribute allows you to designate whether a portion of the page may be posted back.
- The Atlas UpdatePanel control allows you to postback a specific part of a page, and we have this enabled in the ScriptManager control. Data that will be displayed (or updated) is contained by the ContentTemplate element. The Trigger element specifies what causes a postback event. It can be tied to a control event or when a control's value changes--the event is used in this example (when link is selected).
- The SQLDataSource element is used to define our data source. It is referenced in the link's click event and is used to populate the GridView control.
Another approach to Web development
Atlas is the result of Microsoft's plunge into the AJAX
waters. It provides everything necessary to build powerful Web client-based
applications that utilize the core features of AJAX while taking advantage of the ASP.NET
Framework. While ASP.NET is not a requirement, it is easy to use ASP.NET server
controls as well as Web services to make your application more responsive to
the user. Next week, we'll take a closer look at the various Atlas components
available.
Tony Patton began his professional career as an application developer earning Java, VB, Lotus, and XML certifications to bolster his knowledge.




There are currently no comments for this post.