Monday, August 22, 2005 9:42 AM triplez

AJAX - Bringing the client side logic to the server?

I've always been wondering about AJAX and its role in creating rich-client interfaces withinthe web. It has always been client-side scripting, using javascript to create rich client-side experience. But with AJAX, you're able to bring these client-side scripting logic back to the server.

Is it really worth the extra XML-over-HTTP round-about when javascript can solve right now?

Why would people want to use the server-side to do the client-side scripting logic instead?
I think it's usually because it's easier to handle logic on the client-side server-side, with better language features on the server-side. But is it really worth it? I think it's still is the problem of JavaScript itself. The language itself needs to be revamped and updated to support better language features to interface with the DOM. Creating a new client-side script which easily talks to the server-side using AJAX, and easily uses and manipulate server-side generated html (DOM) would be needed.

What do you guys think?

 

Filed under: ,

# re: AJAX - Bringing the client side logic to the server?

Thursday, August 25, 2005 11:32 PM by icelava

"usually because it's easier to handle logic on the client-side"

I think that statement should have said "server-side" instead?

Client-side development is a pain because DOMs are not uniformly standardised across the various browsers. Moreover, Javascript (or in the rare case VBscript) that is necessary to drive the client-side programmability is usually in clear text open for all to see. This is a major security concern, where execution and manipulation of code is beyond that of a developer's control.

The only "real" application platform option for client-side would probably be Java, as I believe not many people want to hear about its-name-that-should-not-be-spoken ActiveX. oops, slip of tongue....

# re: AJAX - Bringing the client side logic to the server?

Saturday, August 27, 2005 12:26 AM by triplez

Oops! You caught me there. It's a typo. :) Thanks!

# Is it JavaScript or DOM that is flawed?

Saturday, August 27, 2005 1:28 PM by stw

You are walking on thin Ajax grounds. Given latency and bandwith a Ajax interaction is priced at 1++++ sec. (Unless it is superfast intranet only). So this slows interaction down to a crawl. The challenge with client side script is the unholy allicance of so-so debugging support and the JavaScript/DOM combination. (I vote: Ruby in the client!!!)
A smarter way out would be to have standard JS function names on your page and some JavaScript Lib magic:
Let's say you have a field "OrderTotal" and you want to check (as a courtesy, not a fail save validation) if the total is within the limit for that client.
So you simply call a JS function ValidateOrderTotal(). The trick would be: the function lives in a Script Library, that is NOT static but computed with all your fancy server logic, so every call to that function might return different code. This way you have a server side computing without the need to resort to Ajax. You even can (using DOM) load such a library dynamically.
So Ajax is hip but not really the greatest thing since the invention of sliced bread.
:-) stw