Polyglot programming is here, and can improve your style. Suggestions on how to inject a little more functional style into your Java, and temper Scala with a mix of Object Oriented and Functional style.
Recently, while the Java platform has been going from strength to strength, improving both performance and support for alternative languages, the Java language has started to appear less exciting than many of the alternatives that now run on the JVM. There is a lot to be said for the modern features of many of these new alternatives, but does that mean the fat lady has sung for Java?
Not so, while we might still not have closures or properties, there are many new and interesting libraries and techniques that can breathe new life and style into your Java source. A stronger emphasis on immutable value objects, use of third party libraries like the Google collections library, DSL like fluent interfaces and more radical ideas like Project Lombok can all help you improve your style, reduce the boilerplate, reduce errors and be more productive with Java. It will bring fun back to your Java development.
The first part of this session will look at libraries and techniques that you can use with today's Java 6, and a peek ahead to Java 7.
Topics covered will include:
Immutable value classes
Builder pattern and fluent APIs
Typesafe "Multiple returns" with Pairs and Triples
Predicates, functions, constraints, identity maps and more with the
Google Collections Library
At the same time, alternative languages that offer much more than Java are emerging on the JVM. Scala is one interesting option that offers static typing but with the same reduction of boilerplate and incidental complexity as many dynamically typed languages. Scala has a strong functional heritage, but also excellent support for Object Orientation, a fact that can greatly ease the transition to this new language. By starting with a mix of OO and Functional, the learning curve is lowered and the results are immediate.
In the second part of this session we will look at Scala, it similarities to Java, and it's easy access improvements. Along the way, some functional techniques will be introduced where they make sense, and where they make life easier. This is intended to be like easing into a warm swimming pool rather than diving in cold at the deep end.
Aimed at beginner and intermediate developers, this session aims to help you improve your productivity and coding style.