Steffen Meschkat, Google (worked on Google Maps) ======================== Reality-Checking the Ajax Web Application Architecture Ajax: A bad name is better than no name. It's client-side scripting done the right way - closely connected to the user experience. Design patterns showed that names are useful - so we'll stick with Ajax. In classic web applications you have forms and pages. Everything happens on the server. Consequences of the Ajax model: * Sophisticated user interaction (like 1990!) * Client side session state - transient session state is managed on the client, while persistent user state is maintained on the server. This corrects a long standing architecturlal aberration. You don't need server-side session state any more! Sessions also cause problems with scaling - you need your whole cluster to know about the session data. Intermission: 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. I didn't quite follow here, but I think he was criticizing web development as a flawed environment. He slates CSS, DOM and JavaScript as all flawed in various ways. DOM nodes have "unspecified partial deserialization semantics" - it is unspecified what the DOM looks like if a page is only half loaded. Also has inconsistent naming schemes. These dumb errors are representative of the rushed nature of the specification. JavaScript - semicolon insertion is bad. Single threaded, but no one tells you so. So, if your JavaScript takes a long time to execute your browser freezes up. Prefers JSON to XML. Practical consequences: Cross browser compatibility problems enforce good libraries. Separation of interaction logic and application logic (they're even written in different languages) is a good thing. Event registration: function ev(node, name, handler) { if (/safari/i.test(navigator.userAgent) && event == 'dblclick') { node['ondblclick'] = handler; } // rest is as normal } Despite the suckiness of JavaScript (stupid name, semicolon insertion, surprising scope rules, poorly specified runtime) it has some cool features: Custom objects, delegation, closures Rich literals, exceptions, functors Has been called "Lisp with C syntax" The name made sense at the time (for scripting Java applets from HTML pages) Demonstration involving a closures for Google Maps. Had a memory leak in IE - it's possible that his next bit (which he had to cut) would show how to get rid of it using a factory function. Challenges: Deployment (caching, compilation, modularization) Bookmarking and History Graceful degredation Frameworks