Wednesday, February 08, 2006

Steven Crossan & Steffen Meschkat of Google

Live Notes from The Future of Web Apps Summit Greater Expectations - Reality-Checking the AJAX Web Application Architecture Steffen M from the Google Maps team. Dissecting the AJAX hype a little bit. AJAX boils down to client-side scripting, done the right way ("but the name CSS is taken"). All of the parts are either nonessential or redundant. All scripting on the web is essentially JS, all interactions are asynchronous. "A bad name is better than no name". Classic web apps. On the client there are only 2 events - click a link and submit a form. Each time the action is replace the entire document. All application logic resides on the server. With AJAX, scripted event handlers are embedded in client side documents. In response to events the document is updated, possibly involving a request for additional data from the server. App-specific behaviour us implemented on the client side. Consequences: Sophisticated User Interaction (partial display updates, modifications, animations; complex manipulations possible; user interaction as with pre-web) and Client Side Session State (transient session state managed on client, persistent state maintained on the server, corrects a long-standing architectural aberration - which also scales very badly). The bad thing about doing something right the first time is that nobody appreciates how difficult it was. Web Technologies give us plenty of opportunity to appreciate how difficult it was. AJAX:

  • XHTML obviously the skeleton of what the client sees.
  • CSS - layout, fonts, colours.
  • DOM (Document Object Model) - no transactions, unspecified partial deserialisation semantics.
  • JavaScript - semicolon insertion (can omit semi-colons at end of lines - to woo Visual Basic users!, single threaded ("but nobody tells you so")
  • HTTP - XMLHttpRequest (notice the capitalisation, let alone the semantics)
  • Data Marshalling - XML, but better JavaScript Object Literals
Sounds bad.. "but whatever does not kill us makes us stronger" ;-) Practical Consequences:
  • Cross Browser Compatibility (different implementation of all mentioned technologies, different but always many bugs, enforces good libraries)
  • Separation of interaction logic and application logic (implemented in different languages, seperated by flexible and extensible protocol, Seamful integration)
JavaScript: Reputedly not serious (ridiculed for the name; semicolon insertion; surprising scope rules; poorly specified runtime), but actually better than its reputation (custom objects, delegations, closures; rich literals, exceptions, functors; has been called Lisp withC syntax; even the name made sense at the time). Don't be afraid of JavaScript :-) Challenges: Deployment (compilation/packaging, modularisation, cache control), Bookmarking & History (in apps quite pedestrian but so are the browsers), Graceful Degradation (smart reuse of transfer format helps a lot), Frameworks (resist the temptation to build one, because there is already one - the browser)

Technorati Tags: , , , , , , , , , ,

0 comments: