Atlas Architecture Overview

This post presents a high level overview of whats in Atlas today, along with the architecture diagram from yesterday's PDC session.

I like to think of Atlas as an end-to-end framework, rather than simply being "yet another AJAX library". Atlas is designed to be an end-to-end application framework spanning client and server development, and the communication between the two. In addition it provides an application framework that enables developers to put together components, and wire them up together. It can be used both declaratively (using XML-script) and imperatively (using JavaScript). Finally it addresses how script functionality can be integrated into asp.net apps as well as HTML pages in a clean, and unobstrusive manner.

In yesterday's talk, Shanku presented a task list application, and an overview of the architecture. This post will provide a similar overview of the architecture. On the left is a diagram of the architecture (hopefully it will convey Atlas' application framework characteristics).

On the client, Atlas provides a set of scripts forming the Atlas Client Script Library consisting of the following:

  • Browser Compat Layer - This is where we abstract out differences between browsers, so that higher level functionality doesn't have to have if... else... code all over the place, or is at the very least minimized. Today we support Atlas running on Safari and Firefox.
  • Script Core - This is something that rightfully should have been part of JavaScript, but it isn't. It includes a set of type system patterns allowing you to use standard OOP constructs such as namespaces, classes, interfaces, inheritance, enumerations, delegates, and so on. The goal is to provide mechanism to encapsulate data, logic, behavior into classes much like you would in any other programming language, so as to enable a disciplined approach to scripting. In addition, we've added a number of more intuitive APIs to built in JavaScript objects to bring them closer to their .NET equivalents.
  • Base Class Library - This was inspired by the BCL in the .NET Framework. It consists of useful types such as StringBuilder, Debug, Event, and IDisposable. In addition, it contains our abstraction over XMLHTTP via WebRequest, and WebResponse (much like their System.Net counterparts). On top of WebRequest, we've built MethodRequest which allow calling into WebMethods defined on .asmx, and .aspx files, or any server class for that matter. This layer also includes serialization - specifically, our JSON serializer, though the intent is to provide other forms of serialization. Finally this layer contains services such as Profile and Authentication that integrate with the corresponding functionality back on the server. All in all, this provides familiar APIs to script code, thereyby making it easier to develop and read/maintain.
  • Component Model and UI Framework - This layer introduces the notion of components (types that can be self-describing of their object model). Components also participate in the dispose mechanism managed by a top-level Application class. Other features build on top of components and their OM descriptions. Specifically we have a parser for parsing script components persisted in declarative XML-script. Bindings allow wiring up components to transfer property values from one component to another (these bindings are "live" via change notifications). Actions allow performing work by calling into component methods in response to events raised by components. The UI framework features specific types of components: controls, behaviors, validators etc. Controls represent UI elements. Behaviors are a mechanism to attach additional semantics to existing controls (eg. Drag/drop). Validators, are like behaviors, but are meant to define validation rules associated with an input control.
  • Controls and Components - We have an early set of built in components such as Timer, and Counter and controls such as the usual set of form controls, ListView, and a map control (based on Virtual Earth) thrown in for some sizzle.

On the server end, we built our Atlas framework bits on top of ASP.NET 2.0. It has three primary pieces to it:

  • Server Control Framework - We have defined a new control ScriptManager that manages the set of scripts sent down to the client, as well as any XML-script markup generated by server controls. Server controls can start to participate in this processing by virtue of implementing IScriptComponent. In addition to this core framework, we have server-side representations of various client component model types, and controls.
  • Web Services Bridge - This allows using both .asmx style and Indigo style .svc services to be used from client script (as well as WebMethods defined on .aspx pages, or any other referenceable type on the server dynamically registered as a Web service). In order to make it simple to do so, we automatically generate JavaScript proxies when the services are referenced via <script> tags. Secondly, we provide the necessary plumbing to process an incoming request with JSON-serialized parameter data, invoke the service method, and serialize the result using JSON to send back to the client script.
  • Application Services Bridge - We use the web services bridge to expose a few of the key ASP.NET application services. Specifically, we currently allow you to authenticate users (using the membership service), and to retrieve and update user data (using the profile service).

I'll talk about our client services piece in the future. For now, I'll just say, its designed to be a mechanism to safely expose mechanisms for client script to integrate well with desktop functionality and other applications on the client.

Over time, we intend to add a number of features, enhancements, and of course address feedback we get from you on top of this core architecture we have put in place. I'll be delving into details over time as well. What are the areas that interest you?

Posted on Thursday, 9/15/2005 @ 8:39 AM | #ASP.NET


Comments

13 comments have been posted.

Henk Feijt

Posted on 9/15/2005 @ 9:50 AM
Hi,

I wasn't at the PDC, unfortunaly, but downloaded the Atlas bits and did the labs. I also had a peek using Reflector at the microsoft.web.atlas assembly and found several atlas controls.

I wonder what will become of the ICallbackEventhandler interface. Will it be integrated in the Atlas framework. Using this interface it is very easy to develop Ajax like controls. I myself made a whidbey version of Bertrand Leroy's refresh panel.

Nikhil Kothari

Posted on 9/15/2005 @ 9:57 AM
Callbacks and Web service calls are complementary. When you want the context of the page and server control tree to perform the out-of-band work, callbacks are the best suited mechanism.

Eventually, we will of course unify the infrastructure so callbacks very naturally build on top of the core networking stack be supplied by atlas.

Sergio Pereira

Posted on 9/15/2005 @ 1:57 PM
I'm really looking forward to spending some time exploring this platform. My experience with developing rich-UI web applications has been that working with javascript can be a real pain. Not because of any language limitation, but to the development tools support and documentation. How often we find an interesting javascript library only to discover that we will have to read the entire source code to learn how to use it? I'm really hoping Atlas comes with some nice set development tools, like enhancements to your Web Development Helper IE bar and, if possible, more intellisense. I think we are past the time of having to learn the source code before using a component or library. Bring RAD to javascript ;)

Richard Hsu

Posted on 9/15/2005 @ 7:16 PM
right from the time i started web app. development with ASP.NET v1, i always wished that MSFT did something about JavaScript programming. my wish was that MSFT write a C# equivalent of Javascript, meaning we use C# [with some features disabled] while it converts it to JavaScript, also intellisense for DHTML controls. i didn't like the mental shift between JavaScript & C#, especially as i was writing a lot of JavaScript. i could imagine doing a C# based JavaScript would have meant a C# .NET flavoured wrappers over the DHTML which would have unified the API.

i thought that google could read the minds of its users. well, MSFT has reassured me about that as well. with Atlas, we get most of what i had wished for, and more [the ajax part].

cool. looks like you're deep into components and frameworks :-)

Daniel Fernandes

Posted on 9/16/2005 @ 1:35 AM
Would Atlas suitable for a fairly complex input screen for instance to apply for a mortgage ?
That would mean around 10 odd screens with each say 10 fields and extensive business logic.

My company is leaning towards XForms as the technology of choice for input forms development but I wonder if Atlas could fit the job as well.

Nikhil Kothari

Posted on 9/16/2005 @ 10:54 AM
Daniel, I think I would definitely urge you to try applying ASP.NET toward your scenario, and also play with the atlas preview, and see how that might help improve the user experience.

Richard, I have in fact been thinking about better script authoring approaches - and have spent some time thinking about exactly what you suggest. Hopefully, now that the PDC is past, I'll have time to put the thinking hat back on, and see what comes out of that process.

Steve

Posted on 9/16/2005 @ 8:34 PM
"my wish was that MSFT write a C# equivalent of Javascript, meaning we use C# [with some features disabled] while it converts it to JavaScript, also intellisense for DHTML controls. i didn't like the mental shift between JavaScript & C#, especially as i was writing a lot of JavaScript. i could imagine doing a C# based JavaScript would have meant a C# .NET flavoured wrappers over the DHTML which would have unified the API."

YES! This is what I was trying to convey in the other blog. I am glad to see you write this so I know I'm not alone :)

congling

Posted on 11/18/2005 @ 5:31 PM
The framework looks great. But there're some issues when i tried the framework.
When I passed the array in js to the back end by using atlas, the framework reported an error "Object of type 'System.Object[]' cannot be converted to type 'User[]'"

Fast

Posted on 12/15/2005 @ 7:34 AM
ATLAS looks to be really a wonderful stuff. I am thinking on studyng the material and conducting some training for people who want to get hands on this. But are we missing the intellisense part?

Namrata Ganatra

Posted on 1/17/2006 @ 12:35 AM
Hi
Thats a very nice article on Atlas ..n i m looking forward to use this technology. but just a question..whether it is legal to use Atlas API in commercial Applications?coz its not yet released and its under BETA period rite? please reply some1.

Steve

Posted on 2/17/2006 @ 5:49 PM
I've gotten into the Atlas framework and it's very impressive. ASP.NET 2.0 brought new client capabilities, almost all being rather basic hooks for extensibility (like callbacks). Smart move, although most things aren't practical for the average developer. Atlas is a great addition and I'm happy Microsoft is continuing work in ASP.NET. It really rounds off the framework. Totally necessary because this is one of those deals where everyone has their own framework (cute). Hopefully this becomes a standard for client-side functionality in ASP.NET because it will really benefit developers.

Regarding a comment already written, the notion of creating JavaScript using a .NET language is something I've thought about a lot. In the end, the goal is to write JavaScript using familiar tools and syntax. Although the design-time support for JavaScript could be improved, it would be best to use C# or whatever to write the script. That way compilation, intellisense, debugging, and other benefits of managed code can be used. Libraries could be provided to wrap browser objects. In the end it would translate to javascript! It's a great idea but it would be so hard to do. Many challenges. Do I smell a product or community project?

Ed DeGagne

Posted on 5/23/2006 @ 11:27 AM
Nik,

It seems the object model has changed slightly with the most recent Atlas CTP. I cannot find IScriptComponent anywhere. Any idea how I can alleviate this issue?

Thanks in advance.

steve

Posted on 6/10/2006 @ 10:29 PM
Nice diagram.

Microsoft Atlas make developer life easier in creating Ajax Website. New Microsoft Atlas Resources is created at : http://www.AtlasASP.com/
The discussion on this post has been closed. Please use my contact form to provide comments.