I went down specifically on an Ajax fact hunting expedition for a project I'm currently working on, and wasn't disappointed with the Ajax track. I attended 3 Ajax sessions, and learned quite a bit from each of them.
The first was "Ajax and Design Patterns: Do we need a client tier?" presented by Dave Crane.
The simple answer to the question is yes if your application is complex enough to warrant it. Initially Dave did a good job of explaining how Java and Javascript differ, specifically looking at Closures (which aren't easy to describe)! This led into examining the MVC and Strategy patterns applied in the client tier and looked at some Javascript implementations.
My session notes:
MVC:
- Model maintained in client (possibly XML or JSON data sctructure)
- Multiple views registered as model listeners with controller
- Views access model state
- Controller invokes view callback functions to update views on model change events
- Javascript allows dynamic reflection on callback functions by function name, i.e. if controller can find a function with a name on a listener it will be invoked.
- Since functions can be referenced as variables and passed around, strategy implementations can be implemented as functions with a closure.
- Function objects in Javascript are a bit like anonymous inner class in Java.
- Example use of a closure to pre-register lunch activities (devour sandwich, clean ear with pencil, ...) when person comes into office in the morning, with objects to interact with (e.g. sandwich).
I found the talk interesting, but on reflection feel a little disappointed that Dave only covered two patterns. I personally would have preferred a higher level view of pattern usage in the client tier, and looked at more patterns without spending as much time on Java v Javascript, syntax, and closures. There's obvious scope for future work in this area.
Next came "Google Web Toolkit: What, Why and How" by Bruce Johnston.
Whilst GWT has been on my radar for a while, I haven't had a chance to look at it at all. From what I saw GWT looks pretty cool.
I really liked the slides about the pitfalls / risks of rich web interface development. I'm experiencing many of the issues highlighted on my current project. It just seems too hard / unproductive hand crafting HTML, CSS & Javascript (even with dojo et al). Fortunately it's still early days, and the UI framework is not set in stone yet.
My session notes:
- Hosted mode customer browser allows Java debugging of UI without opening IE / firefox
- Widgets are styled with CSS
- History support looked well implemented
- RPC support allowed for Java refactoring of client and server code together
- Read the "Making GWT Better" document
- No support for reflection / class loading. The tradeoff was for aggressive performance optimisations in the compiler.
- Native javascript can be embedded in Java source
- GWT can be integrated into existing apps
- Several options for automated test support using hosted browser.
After lunch I ended up at the "Rich Internet Apps with Flex & Apollo" presentation. I had thought of going over to the agile track but am glad I didn't. Flash applications can definitely score in the "wow" factor stakes, the demo'ed applications built with Flex looked pretty slick. The presentation was mostly demos focusing mostly on a table data grid, and various ways that data can be fed into it including xml over http, web service, and a remoted pojo collection. Nice to see spring integration catered for out of the box. Other interesting things include
- the performance test comparing flex to xml & javascript. Flex outperformed XML / Javascript by a factor of 10 when rendering 20000 records in a tabular grid (3 seconds v 30 seconds).
- Live in table data editing
- Real time collaboration demos showing 2 client sessions being kept in synch via the server, i.e. updates in one session, were shown in 2nd session.
The final presentation I went to was "Synaesthesia - Listening to test smells" by Nat Pryce and Steve Freeman. Another good session highlighting how smells in test code often highlight design issues in code. Particularly liked the description of how the objects that an object collaborates with can be classified into:
- Dependencies
- Policy
- Parts
- Notifications
It was interesting to see how some of the audience thought that "logging is an interface" was really contentious. An example was shown of a class with a static Logger, with Nat and Steve highlighting how static stuff is hard to test, yet there was some incredulity that maybe a logging object could be passed / injected as a constructor argument instead.
Got an unofficial update on JMock 2 which Nat reckons will be released before the SPA conference next week.
I ended up in an open space session about People Stuff which has been blogged about here. Had intended to go to another session but it was nice to talk to others for a change.