Wednesday, July 7, 2010

GWT 2.0 and 2.1 at I/O 2010

The release of GWT 2.1 M2 reminded me that I hadn't yet watched the GWT presentations from Google I/O 2010, so I queued them up and have been watching them while doing some incredibly dull (but unfortunately necessary) data mapping.

GWT Testing Best Practices was of immediate interest to me, as this is something that I've put a fair amount of mental effort into as well. This is a good introduction to testing in GWT and makes several of the points that I would have as well.

In a nutshell, GWTTestCase is comprehensive, but terribly slow, so emphasize junit tests. In order to emphasize unit tests, you must be able to isolate your code from the GWT framework, in particular widget classes that use JSNI and rely on the DOM. When attempting to isolate code for testability, dependency injection is important.

In addition to that, the presentation shows some useful examples of writing testable views, talks about testing asynchronous logic, and suggests a different mode of integrating with handlers than Ray Ryan did a year ago (setClickHandler() vs. getButton()).

Architecting GWT Applications for Production is another Ray Ryan presentation which is almost a sequel to his presentation from I/O 2009. It's mostly a rough-and-ready tour of some of the changes coming up in GWT 2.1 with respect to an application framework, as well as the benefits you should expect to get from that. There are some parts of the presentation that apply to changes in GWT 2.0 as well, so even if you're not ready to get into GWT 2.1, you may learn something useful from this.

GWT's UI Overhaul talks about a bunch of the UI changes in GWT 2.0 and 2.1, from high-level layout to cell rendering. Useful to get in touch with the changes already present in 2.0 and coming in 2.1.

Measure in Milliseconds: Meet Speed Tracer is another presentation that ties in heavily to a presentation from I/O 2009. This time around, it's mostly a quick intro to why performance matters (primarily to usability), what Speed Tracer is and how it works, and then delves into specific examples.

Happily, it's these examples that are the most interesting to me, so I think the emphasis of the presentation is just right. 'The Mysterious Case of Too Much Layout' is a good example of the dangers of premature optimization, and why it's important to use a profiling tool that works with the client-side of web application development as well.

It's interesting to see they've extended this from being a primarily client-side profiler to supporting integration with AppEngine and SpringSource TC for integration on the server-side.

Faster Apps Faster talks about how the GWT compiler makes your applications faster, and how to speed up the compilation process. I've read a fair bit about the GWT compiler, but this kind of detail is interesting for people who aren't aware of how much GWT optimizes Javascript, and why that might be faster than hand-written code.

The suggestions for speeding up the GWT compilation process are good: reducing permutations, draft compilation (GWT 2.0), RAID/SSD, 64-bit JVM, etc. Apparently GWT can do a distributed build as well, although it looks like setting it up will be a little work.

Architecting for Performance with GWT has two presenters, Joel Webber and Adam Schuck. Joel's on the GWT team, and has the builder-of-framework perspective, while Adam works on Wave, and approaches it from a user-of-framework perspective.

There are some interesting examples of enhancements the Wave Team has done, like skipping the selection script during initial startup and loading data in parallel with the Javascript, as well as generalized suggestions such as batching requests to avoid sending a series of serialized data requests, or structuring your RPC interface to deliver all the data you need in a single call.

There's also more talk about measuring performance on a continuous manner, which dovetails nicely with speed tracer's new headless capabilities.

GWT + HTML5 Can Do What?! didn't really teach me anything that I expect to use anytime soon, but it was nice to see the GWT Quake port in action, and hear a little more about it. I am interested to see what comes of GWT + HTML5, and the capabilities that adds.

GWT Linkers is fairly low-level for some of you. In essence, it's targeting building something other than a classical web application using GWT, like Chrome Extensions, HTML5 Web Workers, etc. If you want to build something like this, you'll want to learn about GWT linkers, how they work, what they do, and how to write your own.