One of topics I was most excited about at PDC was Atlas, Microsoft's AJAX implementation.

The ASP.NET team is positioning Atlas as not as "just another AJAX framework", but rather an end-to-end framework for developing rich UI in the web browser. It provides a lot of plumbing not just for doing things on the client, but in the communication between the client and server.

The Atlas architecture, which Nikhil discusses here, is basically built of 3 major elements: a client script library, a rich component model on the server, and a series of client application services.

The client has rich WebRequest, WebResponse and MethodRequest objects that mimic the CLR's http request model. Atlas provides a built-in service that exposes any .NET or COM component through their facade. You can, of course, also connect to any arbitrary web service directly - this service is just a means to access existing objects that don't expose a webservice facade on their own. One of the nicest features is automatic generation of the necessary client proxies. You can include <script src="yourpage.aspx/js"/> and get the appropriate proxies. They are using JavaScript Object Notation (JSON) instead of transmitting SOAP or XML - more on this later.

Atlas also promises a better debugging experience, which has always been the Achilles' heels of Javascript development. The experience is not there now, but they said they will eventually add a rich exception management system with tight VS.NET integration.

One of the things I noticed in the first PDC session was that, despite the proxy generation, there's still a fair amount of JS glue that the user has to write. It's fine for lightweight applications and pages, but as we've seen in the past (we did a LOT of JScript development here), it really just doesn't scale well from a maintenance perspective. When you're dealing with an effectively untyped language the maintenance becomes very hairy. We've experienced problems, for example, when people had inadvertently overwritten our framework objects! Atlas has provided some element of scoping and namespaces (something we also experimented with). I'll post more about that once I've had the chance to dig into their implementation.

I also found it interesting that they've provided getter and setting methods for all properties when JavaScript has no concept of access modifiers. You literally can't keep something private - I can even hijack your methods if I choose. (Simultaneously one of the most powerful and scariest features in the scripting environment!). While I appreciate the effort, all this really does is generate more code on the client. In our framework, we used the underscore prefix to designate something as private... we have the same underlying control at the cost of a single character. (Trust me, with JS frameworks, size does matter - even a couple of lines can add up).

They also haven't yet solved another major hurdle we faced - the lack of Intellisense. Of course, this is also an artifact in part of the untyped nature of the Jscript environment. They are working on improving the experience though. For now, you will have Intellisense on the server controls, but not on the client code.

Atlas also offers client-side databinding, including 2-way binding. Server controls encapsulate this end to end. The client side data-binding is very, very neat stuff. A client-side repeater control is exposed, wrapped through ASP.NET.

The demo was a TaskService application. They showed master-details views, binding the child list dynamically on the client. The client supports a rich DataSource object wired up to and generated from a DataService. This is what enables batched updated and the 2-way binding. It was very easy to create an editable client side control - simply setting Direction="inout" on the server control provides this functionality out of the box. All styling is done through CSS.

They've also demo'd Atlas controls, which are effectively DHTML HTC behaviors but work cross browser. They will attach to an element and add certain functionality to the object. Some examples are drag-and-drop, tooltips, floating windows, and various animations and effects.

The bits are now available for download, but they will only work in VS.NET 2005 Beta 2. (Ask Julie if you don't believe me). Nikhil, the lead architect on the team, has also posted the slides and demos from PDC. (Nikhil's blog is a must-read in general).


blog comments powered by Disqus