RSS 2.0
Journal / Blog
Saturday, June 07, 2008
Writing a Control for the AJAX Control Toolkit: Something Stinks
One of my resolutions this year was to contribute to the AJAX Control Toolkit for the ASP.NET AJAX Framework. I began my AJAX Control Toolkit development quest by digging into the online resources, reading ASP.NET AJAX in Action, and decomposing the AJAX Control Toolkit. I noted the huge learning curve required to developing a control, and continued to dig deeper. Once mired in ASP.NET AJAX a bad smell kept wafting by. Since then I've been trying to distinguish this smell.

What's really wrong with ASP.NET AJAX? What's that bad smell?
  • It doesn't plan for performance from day one
  • It treats AJAX as a classic computer science problem
  • It tries to turn JavaScript into a classical language which works against JavaScript's dynamic, prototypical nature
A Case Study: Why Plaxo.com Almost Failed
In the video: High-performance JavaScript: Why Everything You've Been Taught is Wrong (YUI Theater) Joseph Smarr discusses the challenges and lessons learned while developing Plaxo.com. While developing this AJAX centric application, the Plaxo team decided to include everything they could think of (including the kitchen sink) into their application. They created a framework to treat JavaScript as a classical language, they gave priority to features over performance, and... the project ALMOST FAILED. They were able to salvage their application by diverting their development efforts, making performance one of their top priorities, by unlearning everything they'd been taught about classical applications (instead embracing JavaScript), jettisoning unneeded framework bloat, and more.

Some of the points made in this video were:
  • Plan for performance from day one
  • AJAX is not a classic problem
  • JavaScript is not a classical programming language
  • User experience and a responsive application can make or break an application
  • Unneeded bloat in a framework, and an obtuse approach to using AJAX (treating AJAX and JavaScript as a classical language or classic computer science problem) has the potential to cripple your application
This Channel 9 video also mirrors these sentiments: Douglas Crockford, Alex Russell and Joseph Smarr: On the Past, Present and Future of JavaScript
How ASP.NET AJAX Failed: What can we learn from Plaxo?

The way the Plaxo team approached their application development is similar to how the ASP.NET AJAX Framework has been designed. Like Plaxo's initial attempt ASP.NET AJAX attempts to mold JavaScript into a classical language, and attempts to treat JavaScript and AJAX as a classic computer science problem by heaping on more abstractions. Like Plaxo's initial attempt ASP.NET AJAX also gives a low priority to performance. Plaxo was able to change their direction and salvaged their application, but the ASP.NET AJAX Framework is not in a position to make any sweeping changes - ASP.NET AJAX is going down the wrong path and it's too late.

The ASP.NET AJAX Framework is probably another exercise in Framework Architecture (Demoware) and a failure in practice. Its lack of use in the wild attests to these shortcomings - contrast the sites using ASP.NET AJAX with the sites using jQuery (Actions Speak Louder Than Words). Furthermore the places that ASP.NET AJAX does thrive (the small internal ASP.NET business apps that need some bling-bling) will also be the areas that Silverlight shines - Silverlight offers a better Microsoft centric programming model (less leaky Win Form / Web Form abstractions) that most Microsoft developers will embrace. Silverlight will probably divert the developers that currently embrace ASP.NET AJAX.

I don't recommend the ASP.NET AJAX Framework and won't be contributing to the AJAX Control Toolkit. My time is better spent elsewhere.

Tuesday, June 03, 2008
More on the perils of The ASP.NET AJAX Framework
There's no need to whip a dead horse (I've probably been griping about the ASP.NET AJAX Framework for too long), but... Jon Galloway and a group of other notable gurus (K. Scott Allen, Scott Koon, and Kevin Dente) have started a podcast, their latest segment sparked my interest since it covered ASP.NET AJAX and AJAX Libraries / Frameworks in general.

I share their sentiments so I thought I'd post a brief but choppy transcript:
[ASP.NET AJAX] ... does offer some some nice features, they did try to take some of the common pieces of the CLR that [.NET Developers are] used to working with and move that down into a JavaScript library. So you get classes like a WebRequest class that wraps the XMLHttpRequest ... and they have a StringBuilder, and they added methods that we're more accustom with ...

that's wonderful, but I don't find myself needing those extensions all that often. If you want to do strictly client-side programming then something like jQuery offers you a lot more capabilities to do things that you really want to do client-side like sorting and CSS selectors. ... That stuff is easy to do with an Update Panel and ASP.NET, but Update Panels aren't always the best solution to use. ...

the goals with ASP.NET AJAX was to integrate into the ASP.NET server-side model ... that's great for ASP.NET, but it needs more client-side features. ... It works if your thinking from the ASP.NET control perspective, but if you look at it outside the ASP.NET model there are a lot easier ways to do it. ...

ASP.NET AJAX [development] seems to have come to a standstill I'm not seeing a lot of development in that area and the rest of these [AJAX] Frameworks are doing monthly releases. Every month that goes by [the ASP.NET AJAX Framework] falls further and further behind ... it needs to evolve.
Listen to this great podcast here: Technology Round Table Podcast #2 - AJAX Frameworks

Thursday, May 15, 2008
Actions Speak Louder Than Words: Goodbye ASP.NET AJAX
An anticlimactic conclusion about the ASP.NET AJAX Framework - this framework's niche seems to be the internal (intranet) business application realm that depend on ASP.NET Web-Forms. These applications have a handful of users, a couple developers, no performance or bandwidth requirements, little ambition for future growth, and the developers typically embrace dragging & dropping controls in Visual Studio. In this case the ASP.NET AJAX Framework provides some eye candy, and patches the broken Web-Form metaphor by cramming AJAX into the ASP.NET model, but then comes along the ASP.NET MVC Framework, Silverlight, WPF and ... ??? Goodbye ASP.NET AJAX!

Interesting observations:
How many applications explicitly state that they use the ASP.NET AJAX Framework?
  • 25, this includes sites like DotNetNuke (with a reputation of being slow), view the list here.
How many of these applications are relatively high-traffic?
  • None. ZERO!
How many applications explicitly state that they use the YUI AJAX Library?
How many of these applications are relatively high-traffic?
  • Quite a few. A couple notable sites: Flickr, Slashdot, Linkedin, Paypal, O'Reilly, My Opera.
How many applications explicitly state that they use the jQuery AJAX Library?
  • 516, view the list here.
How many of these applications are relatively high-traffic?
  • Many. A couple notable sites: Twitter, Digg, Dell, Slashdot, BBC, Netflix, Technorati, New York Post.
If no high-traffic application uses the ASP.NET AJAX Framework then why would you? Actions (or lack of action) often speak louder than words, and it appears that the ASP.NET AJAX Framework is not suitable for the real world.

Monday, April 21, 2008
The ASP.NET AJAX Framework is for DUMMIES!
The ASP.NET AJAX Framework is an embarrassing server-side centric approach to DHTML / AJAX web development. While most programming languages and frameworks come with both good and bad parts, the ASP.NET AJAX Framework is probably an example of an overall bad part of ASP.NET - on the contrast the ASP.NET MVC Framework looks to be a good part.


What's wrong with the ASP.NET AJAX Framework?
1 .NET Developers are DUMMIES!
The ASP.NET AJAX Framework appears to have been designed under the assumption that .NET developers are dummies and can't learn or don't want to learn JavaScript. That .NET Developers would rather hobble along with their familiar languages, then to learn something new. I understand that the ASP.NET community's only real problem is education, so let's ask: What is wrong with the ASP.NET Community? Then educate ourselves rather than becoming the .NET Developer statuesque. It's patronizing to use a framework that assumes learning a new language is beyond our capabilities. Many of these other programming languages also happen to be more expressive than the statically typed .NET languages.

2. The "don't write a line of JavaScript" abstraction leaks like a sieve
The Framework is intended to shelter .NET Developers from the big bad JavaScript language. Which, like driving a car across North America without knowing how to pump gas, stops you dead. Either you depend on someone to pump your gas - depend on something like the ASP.NET AJAX Control Toolkit and the many authors to write your JavaScript - or you stop moving. As Web Developers, sooner or later learning how to pump your own JavaScript becomes a mandatory skill.

3. Client-side programming from the Server-side is a absurd
The AJAX Framework does back flips to translate server-side code into JavaScript, and then requires that you write JavaScript anyway. Save yourself the pain, learn JavaScript. One day The Law of Leaky Abstractions comes into play, the gas station attendant fills your gas tank with diesel - your AJAX Control Toolkit blows up (requires debugging) so you have to learn JavaScript anyways.

4. Bloated, poor performance, bad user and developer experience
The AJAX Framework extends many of the native JavaScript objects as it attempts to turn JavaScript into a staticly typed programming language, and tries to hook into the ASP.NET life cycle, but all these features are unneeded as they are ALL already achievable through the native JavaScript language - if it walks like a duck and quacks like a duck, then... err... could someone remind me why we need typed languages in a web browser? Anyhow; all these object extensions, enhancements, and upgrades, contribute to more scripts that need to be downloaded and increases the number of scripts running in your browser. Then to make matters worse there's partial-page rendering and Update Panels which do full page post backs under the guise of AJAX -bad-bad! Client-side scripting is supposed to enhance the user experience not make it worse. Other AJAX Frameworks are built with performance as their number one goal, but in the ASP.NET AJAX Framework. Adding more widgets to JavaScript seemed to be the first priority, and performance an after thought.

5. Working against the grain is a waste of time
The AJAX Framework works against the grain, it would be nice if it embraced the JavaScript language. Very few of the concepts and metaphors used in the ASP.NET AJAX Framework transcend AJAX techniques or frameworks - your time is probably better spent learning how JavaScript works or how the other AJAX frameworks work.

6. Disconnected from the ASP.NET MVC Framework
The ASP.NET MVC Framework throws the ASP.NET life cycle away leaving more dead weight ASP.NET AJAX Framework script and rendering many of the AJAX Framework techniques moot.

7. The ASP.NET AJAX Framework almost over looks the 'J' in AJAX - 'J' stands for JavaScript, and that is GOOD
JavaScript is the glue of the web, even the ASP.NET Framework depends heavily on JavaScript, it is not something to shy away from.

8. Aside from local intranet sites, no one really uses the ASP.NET AJAX Framework.
The AJAX Framework isn't widely used. The ASP.NET AJAX site showcases 25 sites using ASP.NET AJAX. None of these applications appear to be high-traffic or moderately high-traffic applications. On the other hand, the YUI site showcases 89 sites, out of these sites, 6 sites (flickr, Slashdot, Linkedin, Paypal, O'Reilly, My Opera) could be considered high-traffic. Other AJAX libraries like jQuery, and Dojo compare similarly. Your time might be better spent learning one of the other AJAX frameworks.
If we (.NET Developers) are going to claim we know AJAX, then let's focus on the core of AJAX (JavaScript) and stop obscuring it in poor frameworks. Frankly the ASP.NET AJAX Framework is embarrassing, the web development community is laughing at the ASP.NET AJAX Framework and the Developers touting it.

Sunday, April 20, 2008
Book Reviewed: ASP.NET AJAX in Action by Alessandro Gallo, David Barkol, Rama Vavilala
The authors of ASP.NET AJAX in Action did an OK (Average) job at presenting the ASP.NET AJAX Framework. However; this book lacked objectivity and suffered from hype. The authors didn't seem to have proficient experience with the JavaScript language, or enough experience with other AJAX Frameworks / Libraries, or sufficient experience using the ASP.NET AJAX Framework in real world projects. This book sadly felt like most technical books - average.

Comments like "we recommend that...", "because it makes no sense...", "you must rely on a special method...", "you must understand X,Y,Z to run complex client-side code without writing a single line of JavaScript" were discouraging. Many of the "whys" were left answered and the technical inner workings of the framework often trivialized. Don't get me wrong, writing a book is incredibly time consuming, but if you're an author, presenter or the like, and you don't fully understand something then admit it. Do some research, provide some links, or move on. Consistently making comments like these bring the integrity of the whole text into question.

The ASP.NET AJAX Framework itself is technically flawed, bloated, and almost entirely impractical. I was disappointed with the server-centric approach that both the book and ASP.NET AJAX Framework takes. I was disappointed that the book continually pushed JavaScript under the carpet as magic and at the end of the book I was pleased to see the promise of making "the JavaScript code disappear" never was  fulfilled. JavaScript is the very most important part of AJAX, without the 'J' in AJAX, we're left with nothing - just 'Asynchronous', 'And', heaps of more ugly 'XML'.

When reading this book, take the contents and the ASP.NET AJAX Framework with a grain of salt, if you're really serious about learning AJAX then read JavaScript: The Definitive Guide by David Flanagan.

I typically only contribute positive reviews, but I don't agree with the majority of reviews found on Amazon and hope this review provides some objectivity. I commend the authors on their hard work, I'm probably being too harsh with this review - I know it's tough to write a book, and imagine they made many sacrifices as they worked towards tight deadlines.

View my review on Amazon.

Wednesday, April 09, 2008
The ASP.NET AJAX Learning Curve
The ASP.NET AJAX framework comes with a lot of baggage err... I mean... a huge learning curve when compared to other AJAX Frameworks like JQuery, YUI, Dojo, Prototype / Scriptaculous.

Here's a running list of the technologies, and concepts you'll encounter when digging into ASP.NET AJAX:
  • ASP.NET
    • The Page Life Cycle
    • The Control Life Cycle
    • Web Controls
    • User Controls
    • View State
    • Session State
    • Events
  • .NET / Classical Language
    • Interfaces
    • Inheritance
    • Delegates
    • Multicast Delegates
    • Assemblies
    • Properties (Get / Set)
    • Constructors
In addition to these, you also have the technologies universal to all JavaScript libraries:
  • JavaScript:
    • Closures
    • Object Literals
    • JSON
    • Events
    • DOM Manipulation
    • Prototypical Inheritance
    • Constructors
    • XMLHttpRequest
  • Cascading Style Sheets (CSS):
  • Web Services
The ASP.NET AJAX Framework is more complex than other AJAX frameworks, I'm continually lost in it's ambiguity as it attempts to skirt around the JavaScript language - I think this learning curve (and all it's confusion) is precisely why Silverlight has so much potential.

I'm still diving into the low-level details, but my first impressions of the ASP.NET AJAX Framework are:
  • Obscure, ambiguous, no clear vision - it offers multiple (resource intensive) ways to avoid writing JavaScript, but then requires that you write JavaScript anyways
  • Too server centric
  • Too heavy weight (I'm not appreciating how they're trying to turning JavaScript into a Java, C#, .NET clone, the overhead within the browser for these conversions seems like a huge performance bottleneck)
  • Has the potential for poor performance
Most of the other AJAX libraries have been written with performance, browser responsiveness, and User Experience as their number one priorities - I'm still not sure about ASP.NET AJAX.

How many ways can we try to avoid writing JavaScript? If an AJAX library doesn't enhance the User Experience then why use it? Regardless, I'm still digging deeper.

Thursday, September 28, 2006
Points of Interest: AJAX and ASP.NET "Atlas" - Developer Night in Canada User Group Tour

Points of interest from Microsoft's ATLAS overview (a TechNet event in Ottawa):

MasterPage/ContentPage Scenarios
You can have a ScriptManager on your master pages, but you need a ScriptManagerProxy if you want multiple script or service references in your content page.
http://www.nikhilk.net/AtlasScriptManager.aspx
Calling external Web Services with ATLAS
... "Atlas" includes bridge technology that enables developers to create gateways (both declaratively and programmatically) to Web services on the Internet. Bridge code runs within the scope of an "Atlas" application, so the browser communicates exclusively with the home server.
http://atlas.asp.net/docs/atlas/doc/bridge/default.aspx
Using just the ATLAS JavaScript Collection without the Pane controls
I have a working (hopefully it still works) Accordion Control on my website: http://adam.kahtava.com/professionalDev/reviews/
Read more here: http://forums.asp.net/1/1347547/ShowThread.aspx
Debugging Tips for "Atlas" Applications
http://atlas.asp.net/docs/Overview/debug.aspx
Debugging JavaScript (Atlas, Ajax)...
http://weblogs.asp.net/rchartier/archive/2005/10/06/426799.aspx
Ajax alert raises security, scalability issues
... Ajax increases the amount of XML, text or HTML network traffic. Relying on XML as the content type for request/response payloads exposes applications to Web services vulnerabilities …
http://searchwebservices.techtarget.com/originalContent/0,289142,sid26_gci1162641,00.html
Related links:
http://www.nikhilk.net/
http://weblogs.asp.net/scottgu/
http://atlas.asp.net/
Tuesday, September 19, 2006
TechNet Monthly - Developer Night in Canada User Group Tour - AJAX and ASP.NET "Atlas" (Ottawa)
Christian Beauclair gave a great overview of ATLAS (Microsoft’s AJAX framework for ASP.NET 2.0). Christian differentiated between the classic post back paradigm and the AJAXian capabilities that can be achieved through ATLAS. I felt the presentation was a little simplistic, but understand that it was intended to give a broad overview of ATLAS and AJAX.

Christian is an excellent speaker I plan on attending more of his events.

Continue reading more here: Points of Interest: AJAX and ASP.NET "Atlas" - Developer Night in Canada User Group Tour

Related links:
Canadian Developers on MSDN
ATLAS (AJAX for ASP.NET 2.0)
AJAX.NET (AJAX for ASP.NET 1.1 and ASP.NET 2.0)
What is AJAX
See AJAX / ATLAS in work on my Reviews page: http://adam.kahtava.com/professionalDev/reviews/
Sunday, September 17, 2006
Resolving Parser Errors: Unknown server tag 'atlas:ScriptManager' in ATLAS (AJAX)
I encountered a number of Parse Error Messages while implementing the Accordion control from ATLAS.

The error messages read:
Parser Error Message: Unknown server tag 'atlas:ScriptManager'.

Source Error:  <atlas:ScriptManager id="ScriptManager" runat="server" />

This message occured for a number of different reasons, this brief checklist should resolve your parse errors.

1) Ensure that the following assemblies are in your bin directory:
AtlasControlToolkit.dll
Microsoft.AtlasControlExtender.dll
Microsoft.Web.Atlas.dll

2) Ensure that the following has been added to your web.config file

<pages>
  <
controls>
    <
add namespace="Microsoft.Web.UI"
         assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
   
<
add namespace="Microsoft.Web.UI.Controls"
         assembly="Microsoft.Web.Atlas" tagPrefix="atlas"/>
   
<
add namespace="AtlasControlToolkit"
         assembly="AtlasControlToolkit" tagPrefix="atlasToolkit"/>
 
</
controls>
</
pages>

Related links:

Data Binding in an AccordionPane in a Repeater
Atlas Control Toolkit: Unknown Server Tag

See my modified Accordion control in action: http://adam.kahtava.com/professionalDev/reviews/
Page rendered at Friday, September 05, 2008 8:28:55 PM (GMT Standard Time, UTC+00:00)