[MIX06] Day 2 - ATLAS
Atlas is an AJAX system for use with ASP.NET. Here are a
few interesting notes from the Atlas session if, like me, you're generally aware
of Atlas but haven't really dug into it that much.
Two client side script formats
In addition to Javascript, Atlas supports a new script type: Text/XML. XML is not a
known script type, so it's ignored by browsers. The Atlas client side
script parses it and converts it to standard Javascript. There are a
few advantage`s to this approach:
- This allows you to program using declarative markup
rather than wiring things up in code. This is similar to HTML or SQL - you
describe what you want done, not how to do it. The Atlas runtime takes care of
the details of turning your specifications into working script.
- XML style markup will allow for designer tools to
edit the Atlas script; this would be much more difficult with Javascript.
- This is easier for the framework to support since it can use standard XML
output systems.
You can see some sample code and read more about it on Nikhil's blog.
HTML / Javascript separation
AJAX functionality is activated through CSS
classes rather than directly calling Javascript functions from HTML
elements via event attributes such as "onclick". This clearly
separates the display behavior (CSS and Javascript) from the content (HTML).
I've been a fan of this markups
based behavior
approach for a while, for both practical and
philosophical reasons.
The practical advantages parallel the advantages of n-tier software design
and semantic web design - clear separation of responsibilities yields
simplicity, which pays of in the maintenance and upgrade phases. This clear
separation also allows for gracefully degrading if, for instance, Javascript
isn't supported on the user's platform.
The philosophical benefit is similar - HTML should
describe content, and CSS / Javascript should describe behavior. The
practical benefits above naturally fall out when things are structured
correctly.
Ready for Prime Time?
The obvious disclaimer here: I haven't used Atlas. I spoke to two ASP.NET
developers who have done some pretty intense AJAX coding on ASP.NET who have
used Atlas, and they told me that it works great for simpler projects but didn't
work great for them in actual projects. One person told me that the UpdatePanel
control only worked in ASP.NET pages, not user or server controls due to the
control event order. I got the impression that it's advancing very rapidly, but
is still a little difficult to use in actual project circumstances.
Now, as I said, these are second hand accounts. I'm only passing them along
to present balanced coverage and relay some real world impressions.
Some other random notes I jotted down:
- Uses JSON / REST.
- Supports client side disconnnected recordset and
databinding.
- Allows easily "ATLAS enabling" a .NET ASMX
webservice.
- Extension method through
extenders.