Server-Centric versus Browser-Centric

James Strachan: Is Ajax gonna kill the web frameworks?:

So is the web application of the future going to be static HTML & JavaScript, served up by Apache with Ajax interacting with a bunch of XML based web services (maybe using SOAP, maybe just REST etc)? If so, do we really need a web framework thats focussed on HTTP and HTML, or are we just gonna end up developing a bunch of XML based web services and letting Ajax do all the templating, editing and viewing?

While I’ve kept [an open mind](http://ajaxpatterns.org/Ajax_Frameworks an open mind), pure separation is certainly the approach I’ve been using and advocating. Perhaps server-centric approaches can work okay for some intranet apps where the emphasis is on getting up and running, and where many developers want to focus on server-side concepts like messaging, DB, business logic, etc. But the bulk of applications are better off as browser-centric.

With tools like Dojo, Mochikit, Scriptaculous, Ajax Pages, you can quite happily get the whole UI encapsulated in JS. Amid all the Ruby uptake (and for good reason), JS has also come along nicely over the past twelve months. Not just libraries, but techniques for OO design, testing, etc.

In addition, as others have pointed out, the approach goes hand-in-hand with SOA: if you’re going to expose a clean REST API on your server anyway, it’s a no-brainer to proceed with a pure-browser UI. Testing becomes a lot easier too. Separating model and presentation has always been a difficult problem in software … when you have a solution as good as this, you have to put up a very strong argument against it.

So why are people still using server-centric frameworks? The biggest force of resistance seems to be the misplaced notion that JS is a hack and we must avoid working with it at all costs. Or maybe it’s less ideological than that, and because people just haven’t had time to learn it. Fair enough – it’s hard enough to keep up with server-side technologies. But a little time learning the basics of JS would certainly ease the pain of web development.

4 thoughts on Server-Centric versus Browser-Centric

  1. Well spoken. However…. a) I don’t see inherit a conflict between server frameworks and ajax/rest based approaches. At the end the server must validate if bits and pieces fit together and there you at least need to orchestrate your services.

    b) I haven’t come across a decent JS IDE — but you might enlighten me — with robust support for Intellisense even for our own objects.

    c) I don’t see it feasible from a security point of view to expose too much business logic in the browser’s JS. So still some heavy lifting needs to be done on the app server. … Anyhow – we are living in interesting times!

  2. Well spoken. However…. a) I don’t see inherit a conflict between server frameworks and ajax/rest based approaches. At the end the server must validate if bits and pieces fit together and there you at least need to orchestrate your services.

    b) I haven’t come across a decent JS IDE — but you might enlighten me — with robust support for Intellisense even for our own objects.

    c) I don’t see it feasible from a security point of view to expose too much business logic in the browser’s JS. So still some heavy lifting needs to be done on the app server. … Anyhow – we are living in interesting times!

  3. The one thing that will kill Ajax (Its already dead in the water as far as I’m concerned, along with nearly all other client side javascript augmentation) is accessibility requirements. Goverments and corporations are under increasing pressure (legal / fear of being sued) to make their content accessible to screen readers. Javascript ties screen readers up in knots. And thats a fact. Most small to medium businesses cant afford the testing time needed to test a site properly with a screen reader. And the price of screen readers are exorbitant too. The development / learning time involved in Ajax is high. This will make most developers (and I mean real developers with real deadlines that dont have time to deliver two solutions like gmail) steer clear. Anyway, Ajax is great for all us sighted developers with tonnes of time and cash.

  4. The one thing that will kill Ajax (Its already dead in the water as far as I’m concerned, along with nearly all other client side javascript augmentation) is accessibility requirements. Goverments and corporations are under increasing pressure (legal / fear of being sued) to make their content accessible to screen readers. Javascript ties screen readers up in knots. And thats a fact. Most small to medium businesses cant afford the testing time needed to test a site properly with a screen reader. And the price of screen readers are exorbitant too. The development / learning time involved in Ajax is high. This will make most developers (and I mean real developers with real deadlines that dont have time to deliver two solutions like gmail) steer clear. Anyway, Ajax is great for all us sighted developers with tonnes of time and cash.

Leave a Reply