The Server Side Java Symposium – Day III

March 20th, 2010 @

Day III started with a Rod Johnson keynote on What’s new in Spring 3.0. Rod was the one the key establishment disturber (establishment being Sun/J2EE) circa 2003 with his widely popular Spring framework. He made a name for himself in publicly denouncing the bloat, complexity and productivity killer of the old J2EE spec and offered Spring as an alternative. Now, many of those ideas found in Spring, and other open source frameworks born in that era, are recycled in the new new JEE 6. Ironically, Rod Johnson now is the establishment.

His keynote underscored that Java is still a tool that does not scale down effectively for simple web apps. Tools such as grails serve that space much better in terms of developer productivity. The new Spring 3.0 tool suite includes ROO, a 2-way code generator that eliminates the need to write boilerplate code in Spring. He took a risk. Instead of powerpoint slides, he opted to write a demo app on the fly. It was a simple app that fetches and displays tweets on a web page. This backfired when he ran the app and it picked up the live tweets of audience members making disparaging remarks about Spring 3.0!

In all fairness, though, Rod made a compelling point that there is a growing chasm between out-of-the-box Java and the features we need to make today’s types of apps quickly. While Spring and ROO are bridging that chasm, I’m starting to believe that functional languages such as Scala and JRuby may be a better tool.

Prime time for functional languages?
That point was driven home by Ted Neward whose presentation focused on patterns in Scala. Aside from the Scala compiler’s ability to infer type, thereby enabling more concise code and static type checking, Scala allows functions to be passed around as parameters in methods (also known as closures). This is the equivalent of C function pointers that Java never adopted. Once you bake that into a language, it is amazing what you can achieve with so little code. A good example of this is iterators used in Java. With iterators, we write much of the same glue code over and over again. It’s difficult to remove the code duplication because there’s too much overhead in creating a helper method. This negates the code reuse opportunity. With closures, you can invert the control and let Scala handle the iteration code. You need only supply the body of the iterated code as a function parameter. Simple yet radical.

Hold your Java hat
Before you go and uninstall your JDK, there are several things to consider. As James Gosling said, Java is really two things: Java, the language and Java, the JVM. So the JVM, including garbage collection and byte code technology, is still relevant since all of these functional languages run on the Java VM. More importantly, though, is the fact that there is too much mind share fragmentation in the functional language space right now. Scala is competing with JRuby, Jaskell and Groovy. Until one language emerges as the leader, you end up with apps being written in different functional language. One third party library may be written in JRuby while another in Scala. In order to inter-operate, you need a common platform to glue everything together. That’s where Java, the language, is needed. So even if you decide to take the plunge into the the functional world, you will still need Java, the language, as a bridging technology for the time being.

Web 3.0 (whatever happened to Web 2.0?)
Scott Davis gave a excellent presentation on Microformats and the Semantic Web. He spoke about the evolution of the web and the next step: Web 3.0. Semantics is the formalization of meta data that is embedded directly in web pages. This allows search engines, or other systems, to extrapolate additional information from web pages and make it actionable. An easy example is a marked-up (or annotized) phone number that appears in a web page. It allows a browser to make the number actionable through Skype. The key take away is that RDFa (from W3C) and Microformats, a grass roots movement, are two technologies to add semantics to web pages without necessarily rendering them.