Skip navigation.

Table Police Busts Wizard ControlAll recent postsBook Review: Punished By Rewards

Client-Centric Approach of Atlas

Nikhil has recently published a couple of interesting posts about the December build of Atlas. I’ve already commented on their resolution to keep page life cycle intact. This time I’d like to offer my opinion on the client-centric approach, as Nikhil dubs it.

I think it’s a bad idea to embed relatively large chunks of XML into web pages for the purpose of “orchestrating” interactions among page elements. Atlas Quickstarts have plenty of examples of this approach. Nikhil gives an example too and says:

As you can see, no messy event-handling code or initialization/hookup logic in the page itself. The idea is this XML Script will eventually be designable and tool-able, so you won’t have to author it by hand, like I just did. I love the ability to encapsulate code so the page is fully declarative, and Atlas enables me to do that on the client as well.

I see a couple of issues with this.

Bloated Pages

XML is verbose. Embedding so much XML Script markup into a web page makes it much heavier. The reason we keep JavaScript code and CSS in external files is because they get cached by browsers on the client. Hypothetically, you can move XML Script into its own file, but it’ll work only for static pages. Dynamic pages would have to embed it.

It is my firm belief end-users should not be punished for large pages. In an earlier entry on view state I said the question of whose responsibility it was to pay for view state was an important one. We tend to inflict view state on end-users. The same thing goes for XML Script.

XML Script is not something expected of you to read and understand. It’s a markup intended for tools, not developers. As such, it has no place in web pages.

Overrliance on Tools

Overriance on tools is what bothers me. I see more and more of it coming out of Microsoft these days. Although it’s great to have tools that take routine work off your plate, these tools are valuable only if you understand the underlying syntax.

Tools have their own agenda, and if you need to deviate a little, you’re stuck: the tool won’t let you do it, and you don’t understand the syntax, which is why you used the tool in the first place.

For example, I could write .NET code in Notepad2, but Visual Studio—which I both love and hate—makes it easier to maintain mountains of written code. I do understand what it does, and I can do the same tasks by hand if necessary.

On the other hand, the shear size of ASP.NET 2.0 sends a clear message: you’d better posess a good tool to cope with it. You can see the writing on the wall when Visual Studio, a product that’s supposed to make money, gets commoditized. The Express edition is free, and there are a thousand and one opportunities to get a free copy.

Having great tools is essential, but building tools upon tools upon tools is crazy.

Debugging

Debugging JavaScript is a hassle, but it’s doable. You’ve got several tools at your disposal: Mozilla’s JavaScript Console, DOM Inspector, and a full-blown debugger Venkman. I don’t quite see how you can debug real-time interactions among controls when it’s being handled behind the scenes according to XML Script declarations. Time will tell.

Conclusion

So far Microsoft has been taking a heavy-handed approach with Atlas. I don’t understand why bloat is preferred to simplicity in this case. Atlas is still in its infant stage, but I hope, in the end, we’ll get something lean and elegant, not a bulky framework with proprietary scripting and markup.

Comments

Comment permalink 1 James Curran |
I don't see the problem with regards to "page bloat". HTML is essentially XML. So, we're replacing one form of XML with another. How is this "bloating" the page? In fact, we're replacing XML+custom script with XML + standard script, so we may see a net size decrease.

But, even if the page is a bit larger -- SO FAR! It's figgin' TEXT! You've need a heck-of-a-lot of XML to take of the size of even a small image file. (for example, you bloated this page by 1.6K just for the back-star-forward buttons on the top right of the article --- just think of what you could have done in 1.6K of XML text!) (For the record, the code in Nikhil's example is only 1.16K long.
Comment permalink 2 James Curran |
booger... I've got to learn to proof-reader.

The line:
"But, even if the page is a bit larger -- SO FAR! "

should read:
"But, even if the page is a bit larger -- SO WHAT!"
Comment permalink 3 Milan Negovan |
The point I was trying to make was that XML Script is dead weight. It is markup created by tools and for tools. Nikhil's example is small, but most examples as Atlas Quickstarts outweigh meaningful page markup.
Comment permalink 4 Scott Becker |
I think things are starting to "click" around here. :)

I LIKE being able to hand-code! I like being able to look at code and see what its doing at a glance. And because the languages I work with are so simple and easy (cough: Ruby on Rails & Prototype), no big TOOL (aka $$$) is required.

Its pretty obvious that MS has a vested interest in building technologies that aren't simple enough to code by hand.

Take your costly bloated tools and code, and shove it Microsoft.

- Scott - Ruby on Rails / Open Source / Linux fanatic / Former ASP.NET Fan
Comment permalink 5 Ira Milller |
Have you looked at Ajax.NET Professional? It sure seems like a more simplified and less 'black box' type approached to AJAX and .NET.

As for RoR... Take a look at MyGeneration. You can script away your data interface layers to your hearts content and still feel like you have complete control of your code from top to bottom. I must admit RoR looks promising (I have 2x as many years on LAMP as .NET) but I still think that ASP.NET is the better platform for my current projects... for now.
Comment permalink 6 Milan Negovan |
We've used Ajax.NET Professional for a little while, but it was getting in the way too much, so we threw it out. Its support is spread over multiple sites and projects; something is going on with licensing, etc. Too much trouble.
Comment permalink 7 Rick Strahl |
Milan,

The server has to send something and whether its XML script, XML data, JSON or an HTML fragment it's probably not going to be too drastically different.

The reality is that tools like ATLAS are trying hard to build more leaky abstraction, but if you really want to the tools are there to build more raw interfaces directly with script code. The JSON Web Service bridge is there for you to call directly and use for data service functionality that you script yourself. Frankly I find that for today's AJAX needs that is probably sufficient for many situations. Most AJAX implementations that are being shown off are gratuitous 'Look what I can do' that serve little practical purposes - the meat of AJAX is the ability to pull data down economically and efficiently.

I mean look at the ATLAS Wiki - how about picking a completely inadequate sample for an AJAX style application.

I've found that if you're looking for a control level framework that is easy to grasp, and economical on bandwidth Anthem.NET (free) is hands down the easiest and comfortable solution.

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):