Lots of freelancers hate having to call up people on the phone and asking if they’ve got any work for them. If only there was a...
Infinite PossibilitiesJan Eerdekens
November might be a drab and dark month in Belgium, but for me as a Java developer it is THE time of the year because it is the month in which Devoxx is organised. Devoxx is 5 days jam-packed with knowledge that helps a developer like me keep up to date with the current state of the Java universe, but also with what the future will bring.
One of the things that makes Devoxx special is that the event is being held in a cinema complex. This means excellent image, sound and seating. Sometimes even too good as some people manage to fall asleep in the comfy seats. Luckily Devoxx, and this year our own ACA IT Coffee Lounge, provides enough caffeine for most people to keep their energy levels up to get through these very busy days.
A busy work schedule means I can’t go to Devoxx for the full week, but I usually manage to attend the first two conference days and this year wasn’t any different. In this rest of this blog I’ll try to give you a short impression of my favourite sessions of those two days.
The start of the first 2 of the 3 Devoxx Conference days is traditionally a series of keynotes by what you’d call the usual suspects: the Devoxx crew, Oracle, Google and RedHat. Keynotes usually aren’t really technical, so as a developer they’re usually something you have to get through to get to the good stuff, but the Devoxx ones have a good track record and are mostly pretty fun and interesting.
The first keynote is traditionally given by Mr. Devoxx himself: Stephan Janssen. He started of by announcing that Devoxx again was completely sold out (actually on the brink of being over capacity) which translates into 3500 people and more than 30 companies/sponsors. He followed this with the announcement of the Devoxx Hunt: a game for the attendees in which they have to use their smartphones to find beacons placed all over the venue and city (including -30000 points honeypots). He also stood still by the enormous success of the Devoxx4Kids initiative and Devoxx spinoff conferences in France (4th year and sold out already in early bird) and the UK (3rd year, 50% more people). The Devoxx concept is so much of a success that next year there’ll even be a Devoxx Poland and there even will be Voxxed Days (small 1 day local conferences that might grow into full Devoxx events someday).
And not only Devoxx is a success, but also Parleys the platform on which all recorded sessions are published (and you get access to as an attendee). Even the JavaOne conference is in the process of uploading their talks which means that by the end of the year it’ll contain 5500 presentations and have 500000 users. And now the Parleys platform will even take the next step and courses will be added.
The final announcement by Stephan was that we will also get a new internet home for the Java community: Voxxed. Think of this as something like a TheServerSide for the new century. And of course the inevitable happened and the site went down during the presentation. I guess they forgot to make a sacrifice to the demo gods.
The second keynote of the day was one by Mike Piech of JBoss about xPAAS. He started by describing that we’re currently working in a completely new context from a decade ago. Today IT has to be more immediate, pervasive and aware, which is difficult in a world where innovation (cloud, containers like docker, microservices, devops) is in a constant battle with legacy and JBoss sees their xPaaS offering, OpenShift, as the solution to this. OpenShift is supposed to provide a unified PaaS experience which they then tried to demonstrate by giving a pretty cringeworthy demo by ‘trying’ to do something with memes, but don’t take my word for it, just check this.
Last of the keynotes on day one was by Oracle’s Brian Goetz in which he went over the history of Java up until where we are today with Java 8. He started off with the fact that Java is 20 years old already, but still going strong. So sticking to what got us here in the first place should be a good strategy to evolve Java. This means that they want to add as little as needed while still sticking to the principles of simplicity, readability and transparency. That is why for example generics took 10 years to be good enough to be put in and why we only got lambdas in 2014.
Next he talked a bit about what the future will bring with Java 9. Java will have to run on smaller and smaller devices, security becomes even more important and for the first time with Jigsaw some stuff will change dramatically as some internal APIs won’t be available anymore as will be rt.jar and tools.jar. He even speculated a bit about the direction of Java after Java 9 with Project Valhalla (Value Types, Generic Specialization, Reified Generics, …) & Project Panama.
Brian was followed on stage by Richard Blair and Jasper Potts who gave a short talk about the Internet of Things where lots of different architectures and protocols have to work together (by means of e.g. mesh networking) and demonstrated this with their telematics java car demo.
The Google Keynote that started off the 2nd conference day was a bit different than usual as it was a nice combination between technical and design, instead of almost all tech(nical), as they presented Google Papercraft. Papercraft is their new project that uses the concept of Material Design to try and provide a flexible approach to create a coherent cross platform experience. It has its roots in Project Kennedy (unifying the look of their webapps) and Project Holo(unifying the look of their mobile apps). With Material Design they’re now trying to take the next step where they unify the look of all their applications, web or mobile. They do this by using a few key concepts:
- Tangible surfaces: your view is like a stack of paper; the planes are malleable, have an elevation and react to click/touch
- Print like design: based on real world paper typography with refined fonts and font sizes that work well in relation to each other, supported by baseline grids and keylines
- Bold color: while the visual style is light it employs one very bold accent color (and a couple of derived, matching, less bold colors) with API support to create these swatches based on the accent color
- Meaningful motion: like the previous concept, motion is used sparingly, but effectively in the places where it makes sense, again with API support
To me it kinda looked like Google’s version of Twitter Bootstrap, but on steroids and not only for the web.
Modern Web Architecture
Next up was a talk by the always entertaining and seriously funny Ted Neward about web architecture. Like a lot of the other talks I attended this one to started off with a look at history, in this case the history of the web/web applications.
This journey through time started off with Project Xanadu (which Wired magazine described as “he longest-running vaporware story in the history of the computer industry”) which can be thought off as the origin of Hypertext. A concept that was later made into something that actually works by the famous Tim Berners-Lee. This work resulted in the 90’s in the first generation of the web, which consist of mostly static content of which he gave a very appropriate example: the original Space Jam website (which is remarkably still online).
In the second generation of the web we got some more dynamic sites using technologies such as CGI, Java applets and Flash to retrieve data from somewhere, show it to the user and allow for some interaction. This in time evolved into technologies such as PHP and Java servlets to create more complicated web applications. These and other technologies were able to show pretty complicated user interfaces to the end users, but after a while it became clear that there was a growing set of users that is more interested in the data that is being made available by your interface than the interface itself. This resulted first in various screen scraping technologies, but later in actual technology to make the data directly available such as web services and more recently JSON/REST. But even with the latest web architectures there’s still problems such as link rot, security and redundancy/resilience.
The talk was rounded off with a look at what’s next in Modern Web Architecture:
- It needs to avoid common fallacies like that the network is reliable, latency is zero, bandwidth is infinite, the network is secure, … (once in a million happens on a weekly basis at Amazon)
- It needs to be modifiable, scalable, performant, reliable, secure, interoperable, … (and outside of the US: internationalized)
- Platform oriented like Twitter, Facebook and Salesforce
Groovy in the light of Java 8
The last talk of day 1 for me was by Guillaume Laforge about Groovy. In it he took a hard look at the necessity of Groovy in a Java 8 world. With Java 8 there now seem to be a lot of possible redundancies between Groovy and Java 8:
- Closures vs. Lambdas
- Traits vs. Default methods
- Truths/null vs. Optional
- Functional with collections vs. Streams
- Method closures vs. Method references
For each of these he showed that Java 8 now indeed has similar functionalities (with maybe even Groovy as inspiration) that Groovy has had for years. Even with these similarities, Groovy still has enough leftover functionality to be very useful alongside or in combination with Java 8:
- Android support: Groovy can be used in Android to support Java 8 like functionality that isn’t available natively yet
- Builders: for JavaFX, XML, JSON, …
The message he closed the talk with is that Groovy still has its uses will continue to do so because the Groovy team will always continue to innovate like they’ve done in the past.
Modern Enterprise Java Architectures with Spring 4.1
On day 2, 1 of the Spring founders, Juergen Hoeller, gave a nice state of the union of the Spring world with regards to Java 8 (one of the main topics of this year’s Devoxx). He started off with the fact that in the quickly changing Java landscape, with its new deployment models (docker, embedded servers, …), non-DB datastores (NoSQL, Graph DBs), lightweight messaging, … Spring needs to keep up. It does this by upgrading its baseline to Java 6, Servlet 2.5 and JPA2. While this seems to be not as ‘new’ as you would expect, it was done with (backwards) compatibility in mind, but with a focus on Java 8, Servlet 3.0 and JEE7 support. So you can still use most of the newer Spring 4.1 on older environments, but everything will also work in an environment based on the latest and greatest.
The highlights of Spring 4.1 are:
- Configuration classes: composable annotations (think meta annotations) with overridable attributes with default/mandatory values, generics based injection matching (reducing the need for qualifiers), ordered collection injection and lazy injection is now also available for method params
- JSR standards support: support for @ManagedBean, @Inject, @PostConstruct, … and the ability to mix and match these with Spring’s own annotations (Spring versions will still be the most powerful), Optional<> injection points, declarative date/time formatting and lambda support in various Spring APIs like the various templates
- Scheduling: declarative scheduling with @Async and @Scheduled (multiple annotations of same type are possible with container annotation)
- Various: annotated MVC controllers, Stomp support for websockets, annotated JMS endpoints, declarative caching
His talk was rounded off with a short code demo using Spring Boot which served mainly to demonstrate the ease with which an application can be created using http://start.spring.io/.
Java 8, 9 and beyond – Ask the experts
Usually during Devoxx there’s always some sort of expert panel and this year was no different. The term ‘panel’ in this case might be a slight overstatement with only 3 people on it: Brian Goetz, Paul Sandoz and Stuart Marks. While I don’t want to take anything away from Paul or Stuart, in my humble opinion you could put Brian on stage by himself and he’ll be able to keep a room full of Java devs entertained for a couple of hours. The panel was pretty freeform as there wasn’t anything prepared and all questions were taken live from Twitter using the hashtag #JavaQ, but this actually served its purpose pretty well and there wasn’t a dull moment and the session was over way to quickly.
The main takeaways of various topics the 3 talked about were:
- Reified generics: a lot of people think they need/want them, but haven’t really thought it through. There have been various mental and practical exercises around the issue, but none of them satisfactory and all with unwanted side effects (like bringing the type system into the VM) that would mean big trouble for other JVM citizens like Scale or Ruby. Brian excellently summarised this with the quote (accompanied by a well know hand wave).
- Jigsaw: hopefully low impact on normal Java devs, getting rid of classpath hell (who wouldn’t like that!) and you shouldn’t have to use it, but it’ll improve your life if you do.
- No Java 9, straight to 10: will definitely not happen as there is lots of activity for 9, but no earth shattering features
- Parallel streams: don’t use them by default! They always have an associated cost and there has to be enough data to make them useful and to recoup that cost. Use them only when actually needed, which means measuring first (and please do this measuring using jmh (Aleksey Shipilëv) as System.currentTimeMillis is usually wrong)
- Backwards compatibility: lots of people want to know why they don’t just break backwards compatibility to implement feature X and the surprising answer is that they’ve never done until now, don’t want to throw anyone under the bus and that this way of working has made Java what it is today (maybe both in a good and/or bad way).
- REPL: Java will get a REPL following many examples like Scala, …
- Collection literals: didn’t make the cut in Project Coin and Java 8, they’re looking at it for Java 9, but each time they look at it the problems looks bigger and deeper than you’d think. Guava’s .of() is already a good option for lists, but the main problem is maps as there isn’t a Tuple/Pair in Java (yet). Pair might see the light of day as a value type in the future, but for now they think it is best to delay the feature until it really is ready (following the backwards compatibility stance). With this feature we’d also get a way to ‘zip’ 2 streams as this would result in a list of pairs.
- Will JARs go away: nope, never, JARs are here to stay because they are actually a very fine format for portable stuff. Extra stuff might be added to JARs to make them into modular JARs.
- Will checked exceptions go away: this question was answered with the following quote “we’re gonna keep throwing them”. An informal show of hands showed that while there is a vocal minority that wants to get rid of them the actual distribution is more like 50/50. They did however acknowledge that there are problems with checked exceptions, but most of those are by misuse of them in (their own) libraries where they should’ve been unchecked.
The panel was rounded off by asking all panel members their most hated and most wanted Java feature. The most hated feature was almost unanimously serialization or as they put it: the gift that keeps on giving. The most wanted features were: Tuple/Pair and multi value streams/returns.
Honorable mention: The Codeless Code
My last session of day 2 at Devoxx was The Codeless Code by Martijn Verburg. He might not have been the speaker that was supposed to give the talk, but his natural style (and outfit) made him the perfect guy to deliver this talk. He is usually referred to as the Diabolical Developer, but in this talk he took on the role of a Java-Fu Master that explained the most common pitfalls of our daily working life using very appropriate Chinese Kung-Fu parables. As I’m not nearly good enough to reproduce his fantastic tales of how apprentices of the various clans (Crawling Spider/Flying Monkey/etc…) get enlightened by their masters I can only point you to the excellent source material he used:
In the two short days I was at Devoxx I had tons of fun absorbing a lot of new information. The only real problem I have is that there is so much interesting stuff to see, learn and do that I’d need to clone myself to be able to follow all the sessions I would’ve liked to. So in my opinion, even when placed against the original Java conference, JavaOne in San Francisco, Devoxx is still the Java conference to beat. If you have developers that want to go, send them, as it is the best value training they can get on a yearly basis.
And to end this blogpost I’d like to point you to the must see Ignite Session by Stuart Marks (that I missed) with the mysterious title: OpenJDK Development Using Tactics from Game of Thrones