Assessing Atlas

Aug 23, 11:00 pm

Article Author: Mohammad Akif
.NET 3.5 Books

Introduction


The Ajax style of programming allows web applications to become more interactive and responsive through the use of asynchronous communication to the application server. Microsoft’s Outlook Web Access application, which allows users to check their email on the web through a user interface that looks much like the desktop version of Outlook, was an early example of an Ajax style of programming. Some of the key technologies behind Ajax, for example the XMLHttpRequest object that allows developers to exchange data asynchronously with the web server, were originally developed by Microsoft many years ago.


The Ajax technique got a major boost more recently due partly to a number of high profile web sites, including MSN Virtual Earth (http://local.live.com/) and Google Maps (http://maps.google.com), that used this model and partly to the increasing need by businesses that have started using the web as a major channel to connect with a significant percentage of their customers. The quest to improve the user experience on the web has resulted in a tremendous increase in interest of Ajax. I recently attended JavaOne 2006 where in my opinion the three major themes were Ajax, Ajax and Ajax and the enthusiasm of JSP developers about Ajax is matched to a slightly lesser degree by the developers currently programming in ASP.NET. For the purposes of this article I am assuming that you are familiar with the basics of Ajax, please refer to my blog (http://blogs.msdn.com/mohammadakif/archive/2006/01/14/512991.aspx) or other online resources if you are unfamiliar with the core tenants of Ajax.


Ajax allows your applications to become more interactive and responsive and increases the user interface capabilities, however, it also introduces significant challenges. Firstly you need to have expertise in Javascript, DHTML and asynchronous programming. The asynchronous programming model also introduces conversational state issues that require experience and careful thought in terms of the design and exception handling strategies. Secondly, most enterprise applications require integration with a server side application model which is not easily possible with the majority of Ajax engines. Lastly, there is a lack of good tools and established best practices for Ajax-based applications; this has been a major impediment to implementing mission critical applications using this model.


Microsoft has been a strong supporter of offering language and programming model choices to customers to allow them to select the technology that best suits their needs. In the area of web technology, ASP.NET 2.0 already supports Ajax-based programming, however, in order to further facilitate development of the next generation of web applications, Microsoft recently released the Atlas framework. Atlas is not just another Ajax engine, it is the evolution of concepts that form the core of Ajax style of programming. Beyond the zoom-ins and zoom-outs and slick user interfaces that every Ajax engine promises and that seem to be getting the attention at IT shows, Atlas allows you to develop enterprise class Ajax applications. It is designed to reduce the amount of time and resources spent in learning and implementing the Ajax plumbing, allowing developers to focus on solving business issues.


What is Atlas?


According to Atlas’s official web site, it is "a free framework for building a new generation of richer, more interactive, highly personalized standards-based Web applications". It is an easy-to-use, high-productivity framework which has full integration with server programming model, provides a set of tools for Ajax-style applications and is cross-platform.


The Atlas framework is comprised of a set of client libraries, server controls and web services that allow you to realize the advantages of Ajax while significantly reducing its complexity, development and maintenance pains. The Atlas libraries are based on object-oriented style of programming and add OO features including a type system, namespaces, data types and events to JavaScript, which makes it much easier to reuse and maintain the scripting code. Another major issue faced by Ajax programmers is the lack of compatibility between different browser types and versions, the Atlas libraries have built-in capabilities for handling most of the compatibility issues so that programmers do not have to deal with them, these compatibility scripts are invoked automatically when each particular browser type is encountered. Furthermore, Atlas is built to enable incremental support for future browser versions, for example, it can utilize some of the local storage capabilities of IE 7.0 for occasionally disconnected scenarios. When other browsers add similar capabilities in the future, developers will be able to access that functionality to improve the user experience on those browsers as well.


In the area of user interfaces, the Atlas libraries allow you to create Atlas components using procedural or declarative syntax and have capabilities for handling remote procedure calls. The libraries also reduce the complexity of making asynchronous calls to just a few lines of scripting code which greatly enhances developer productivity and reduces the chances of errors. You can visit http://atlas.asp.net/docs/Walkthroughs/GetStarted/Basic.aspx for an example of how to make an asynchronous call to a Web Service and implement a callback.


Atlas also allows you to build gadgets, which are reusable pieces of functionality that encapsulate user interfaces and behaviors. Gadgets provide interaction with users beyond a single site and can be hosted on Live.com or the Windows Vista sidebar. You can visit http://atlas.asp.net/docs/Walkthroughs/DevScenarios/gadget.aspx for an example of how to add a gadget using the Atlas libraries.


Finally, Atlas provides a set of commonly used behaviors, including drag and drop, auto-completion, mouse hovering, tooltips and pop-ups that developers can utilize to enrich the user experience. It also contains components that can be bound to data, which reduces the amount of effort you need to create and maintain data-driven business applications. The Atlas components are extensible and you can also create new components to share amongst your group and organization.


In addition to client libraries, Atlas also includes server controls that can generate the client scripts needed for using Atlas features. By using these controls you can start programming Ajax style applications even if you are not a JavaScript expert. Atlas also provides ASP.NET web services that can add useful server-side features to an Atlas application. You can visit http://atlas.asp.net/docs/Walkthroughs/GetStarted/ServerAutoComplete.aspx for an example of utilizing Auto-complete through a server control.


Please note that the server side components from Atlas are optional, Atlas supports both a client and a sever centric model and you can choose between them or create a hybrid. I will discuss these two models separately in later sections of this article, but let us take a look under the hood first.


Components of Atlas


As I mentioned previously, Atlas offers both client and server side components. The Atlas client libraries consist of four logical layers: base class libraries, core user interface framework, user interface toolkit and JavaScript extensions. On the server side Atlas ships with bridges for JavaScript Object Notation (JSON) and Mash-ups. JSON is a lightweight data-interchange format based on a subset of the JavaScript Programming Language, in some cases it is better to use JSON especially when marshaling data from client to server as it is easier to de-serialize and is less verbose compared to SOAP; you can visit http://www.json.org/ for more information about JSON. Mash-up refers to the idea of building applications which access data from remote domains (typically through web services), consolidate it in a useful form and serve it to the client browser. You can visit http://atlas.asp.net/docs/Walkthroughs/DevScenarios/bridge.aspx for an example of how to build a mash-up using the Atlas libraries


Figure 1 shows the core components of the Atlas framework, you can find details about each of the individual components in the links section of this article.



Figure 1. Core components of the Atlas framework


Atlas Application Models


Applications developed using Atlas may be client or server centric, or a combination of both. Client-centric browser applications use Atlas client libraries for data, services and composition and make full use of DHTML in the presentation tier. Using a client-centric model allows you to provide a user interface with features that have traditionally been available in rich client applications only, for example, you can allow the users to rearrange different sections of the web page by dragging and dropping components on the screen. In order to develop a client-centric application you will need some level of expertise in JavaScript, Microsoft plans to include Atlas in the Orcas release of Visual Studio which will make it even easier to develop these types of applications. You can visit http://atlas.asp.net/docs/overview/install.aspx for an overview of how to create an Atlas application using the current version of Visual Studio. I have provided an illustration of the client-centric application model in Figure 2.



Figure 2. Client-centric application model


Unlike the client-centric applications, in case of server-centric applications the core application logic and user interface behavior is hosted on the server side. This model works well with existing server application models and does not require developers to gain expertise in JavaScript which can be a critical factor in a project where it is not possible to dedicate time for training. Atlas applications use Ajax techniques to reduce full roundtrips by enabling incremental page updates. It allows you to define the various parts of the page as updatable through a few lines of code, for example, using the code below you can make a TextBox capable of being updated separately from the entire page.



<atlas:UpdatePanel id="customerPanel" runat="server">
    <ContentTemplate>
        <asp:TextBox id="text1" runat="server"/>
    <ContentTemplate>
</atlas:UpdatePanel>


In the example above, I used the <UpdatePanel> tag and one of its child tags <ContentTemplate> to allow the textbox to be refreshed without the need to postback the entire page, Atlas handles all the plumbing involved in the update including the asynchronous calls to the server. Figure 3provides and illustration of the server-centric application.



Figure 3. Server-centric application model


Whether you decide to use the client or server centric model or some kind of a hybrid depends on the nature of your application, the skills set available on the team and any existing code.


Getting Started with Atlas


There are many Ajax engines available in the market which can be used to develop new Ajax applications; however, one of my favorite features that separates Atlas from the others is the capability to integrate with existing web applications. This allows you to enrich them without the need to start from scratch, furthermore, for existing Microsoft developers, Atlas’s integration with Microsoft development tools means that you do not need to deploy and learn an entire new tool set.


In terms of getting started with Atlas, I strongly urge the readers of this article to spend at least a few hours in learning the core concepts behind Ajax. Although it is possible to start developing Atlas applications without an understanding of Ajax, your chances of avoiding mistakes and producing a quality application will increase significantly if you understand the dynamics behind this model. You can read more about Ajax at http://asp.net or at my blog post at http://blogs.msdn.com/mohammadakif/archive/2006/01/14/512991.aspx.


Once you have a good understanding of Ajax, visit the Atlas Web Site and go through the tutorials and walkthroughs available in the Atlas quick start tutorials section of the Web Site, I would suggest going through the walkthroughs that describe the various scenarios you can implement with Atlas and then try to expand those by implementing a proof-of-concept. If you do not have experience with JavaScript you may want to start by implementing a server-centric application, examining the generated scripts and referring back to the documentation on the web site to understand the key portions of the generated scripts. Once you feel confident enough, you can start by trying to improve the user experience of an existing web application and then take it from there. Programming Ajax does require a change in thinking in terms of what an application can do, so my general advice is to take a crawl-walk-run approach rather than a big bang. Finally I would suggest checking the What others are doing with Atlas section of the web site to get an idea of the possibilities that this technology has opened.


Atlas vs. Rich, Smart and Traditional Thin Clients


One of the most common questions is about how Atlas relates to other technologies from Microsoft, such as ASP.NET, Windows Forms and Windows Presentation Foundation. Windows Presentation Foundation is a framework for building user interfaces that could only be built by very experienced graphic programmers in the past. Windows Presentation Foundation (WPF) is part of .NET 3.0 that will be released with Windows Vista. I am a big proponent of the Ajax model and have been for some time, however, Atlas or any other Ajax engine is not the most suitable option in every scenario. In this section I discuss some of the factors that you should consider while trying to choose between these different models. Please note, that this general guidance may not be applicable in every case and is meant to encourage a way of thinking rather than provide a hard criteria for selecting a particular model.


Let us start by exploring Atlas vs. the rich and smart clients. For the purposes of this article I have used the following definitions:


Rich Client: Applications that require deployment on the client site, typically capable of working offline. Rich clients are also known as thick clients or fat clients, and examples include software that you install through a CD/DVD or download from the web and install on the desktop. You can use technologies like Windows Forms and Windows Presentation Foundation to develop rich clients.


Smart Clients: Applications that are hybrids of rich and web clients. Typically, smart client applications do get installed on the client site but are capable of updating themselves in an automated manner based on a pre-defined policy. You can use Windows Forms, or Windows Presentation Foundation with the ClickOnce technology to develop and deploy a smart client. You can read more about smart clients and ClickOnce technology at http://blogs.msdn.com/mohammadakif/archive/2006/04/01/566581.aspx.


When not to Use Atlas


Atlas allows you to provide a user experience through web applications that is not possible or is very difficult to do using traditional web application practices, however, while Ajax style applications are a significant improvement they cannot be considered equivalent to what is possible in a rich or smart client in terms of user experience. You can provide a level of user experience through Windows Forms and Windows Presentation Foundation or other non-Microsoft rich client technologies that cannot be matched by any HTML-based approach. Being in IT we all know that part of our job is to provide the best possible solution to the business and in many cases that would still mean a rich or smart client solution. Also, Ajax applications rely on always being connected with the network, if you have scenarios or legal requirements where you need to allow users of your application to work offline then you will need to implement a rich or smart client solution. Finally, if your application needs to take full advantage of the local resources due to performance or other reasons then you will need installed components on the client side.


In terms of Atlas’s relationship with the current ASP.NET application, just because there is a lot of hype about Ajax it is not a good enough reason to move to the model. If your team has expertise in ASP.NET and your application requirements are met or exceeded with the current model then there is no need in the short term to add the technology for the sake of technology only. Also, even if you do need to implement an Ajax style of programming with Microsoft technologies, you don’t have to use Atlas to achieve this. However, using Atlas is a natural choice as it will allow you to spend resources on resolving the business problem rather than spending time on the underlying plumbing for making a responsive web application. Not using Atlas will mean that you will be reinventing and maintaining some of the functionality provided through Atlas.


When to Use Atlas


The ideal case for using Atlas is where you need to have a broad reach in terms of the number and type of users, and want to enhance and improve the user experience beyond what is possible in a traditional web application. The table below provides a comparison for the various available technologies; you can create a similar type of table in terms of what is important for your project in order to choose the right approach. Please note that I created the table based on my experience, however, the importance, relevance and the relative comparison maybe different for your project. For example, if your team has more expertise in ASP.NET than Windows Form, then developing an ASP.NET solution will be the easiest for you from a resource perspective. As I mentioned previously, ASP.NET supports the Ajax style of programming even without using Atlas, however, I have used the term, ‘non-Ajax ASP.NET’ to refer to applications that are not using Atlas or custom developed Ajax techniques.





































Criteria/TechnologyRich ClientSmart Clientnon-Ajax ASP.NETAjax/ATLAS
User interfaceBest possible user interface featuresBest possible user interface featuresLess possibilities than rich or smart clientsMore than non-Ajax ASP.NET, less than Rich or Smart client
Reach Needs installation on client machinesTypically needs installation on client machinesCan be accessed through a browserCan be accessed through a browser that supports JavaScript
Cross platformRuns on MS WindowsRuns on MS WindowsRuns on multiple browsersRuns on multiple browsers
Distribution and UpdateNeeds download or shipping, potential versioning issues in terms of DLLsCan get updated automatically, greatly reduces the update effort, supports a variety of scenarios User always gets the latest version, nothing is installed on the client machine User always gets the latest version, nothing is installed on the client machine
PerformanceBest possible performanceBest possible performanceDependant on the networkDependant on the network but user experience can be improved through partial updates and asynchronous calls
Developer skillsTypically the easiest to developSimilar to rich clients with some additional learningEasy to develop, requires an understanding of web technologiesEasy to develop but requires some additional learning over non-Ajax ASP.NET
Offline capabilitiesCan work completely offlineCan work completely offline except for updatesCannot work offlineCannot work offline except in very limited scenarios (occasionally disconnected)
SecurityCan be extremely secureCan be extremely secure, the automated update process can utilize digital signaturesCan be extremely secureCan be extremely secure
Access to local resources and devices Easiest possibleVery easyEasy but requires additional steps and has limitationsEasy but requires additional steps and has limitations
Accessibility (for people with disabilities)Development tools support building accessible applicationsDevelopment tools support building accessible applicationsASP.NET 2.0 and Visual Studio 2005 supports building and testing for accessiblityPossible, but requires significant additional work (applies to all Ajax engines)



Conclusion


Atlas is a framework by Microsoft that you can use to enrich existing ASP.NET applications as well as produce the next generation of web applications with a much more immersive experience for users. Atlas allows you to significantly improve web applications through a richer user interface and more interactivity made possible through the asynchronous communication model. Atlas is a great solution for a number of scenarios, however, it does not replace rich or smart clients and is not the most appropriate answer in every case. Microsoft allows you to choose between various programming models and in my opinion you will get the best results once you understand and outline the business requirements and then map it to the best technology solution rather than starting with the technology and try to fit the problem to a pre-determined solution.

Founders at Work

Commenting is closed for this article.