About the Author

Phillip Verheyden

Software Architect


SpringOne 2GX 2014 Postmortem

This chronicles my experience as both an attendee and a speaker at SpringOne 2GX 2014 in Dallas, Texas. Feel free to view my presentation that covers how to migrate from Spring 3 to Spring 4 here.

Monday Day 1 -- The Arrival

I arrived in Dallas the night before so I had plenty of time to get settled and make a short trek out to the Broadleaf Dallas offices to see some of the folks there. Even though I am just a short 200 miles up the road in Austin, sometimes it feels like they are an eternity away! I made sure to steal stock up on some Broadleaf branded ping-pong balls. Yes, you should be jealous!

Monday night kicked off the conference with an excellent dinner (the food all week was amazing). Then we jumped straight into the various keynotes of the evening. Hugh Williams had a great introduction to Juergen where he related a story where the Spring team refers to being admonished by Juergen as being "polished". Hugh decided to coin a new phrase and call it "Juergenized"! He even made a t-shirt! platform platform juergenized

Juergen Hoeller and some of the other Pivotal folks then talked about what is here and what is coming next for Spring in regards to the Spring Platform and Spring Boot (the definitive center of the Spring Platform). This was the first of many plugs for Spring Boot; nearly every talk at the conference mentioned or used Boot in some way. If you haven't looked at Spring Boot yet then you absolutely should, it's what Spring Roo should have been from the beginning.

The post-talk receptions are always my favorite part of conference. This is not just because of the free food/drinks (which is awesome) but because of the great conversations that come out of that many like-minded people (~800 was the final count I heard) sharing space together. One of the coolest things I heard about was how some people were using Spring Data to eliminate boilerplate in their CRUD operations.

I went to sleep that night under the bright lights of Reunion Tower. A great first day to the conference! reunion tower

Tuesday Day 2 - "Thank you for a sane mocking API"

Full schedule: https://2014.event.springone2gx.com/schedule/2014-09-09

Tuesday was completely jam-packed with talks and it was hard to keep everything in my brain. The track that I made for myself:

Both of Pieter Niederwieser's talks were great. Pieter is the author of Spock which is what we have begun to build all of our new tests on. The killer feature of Spock is the sane mocking API (which I dutifully thanked Pieter for). If you have not seen it before, here is an example of a mock that we wrote to test one of our Broadleaf classes:

EntityConfiguration mockEntityConfig = Mock()
mockEntityConfig.lookupEntityClass(_) >> { String entityClass ->
    if (Product.class.getName().equals(entityClass)) {
        return ProductImpl.class.getName()
    } else if (Category.class.getName().equals(entityClass)) {
        return CategoryImpl.class.getName()
    return entityClass

I cannot say enough good stuff about Spock and I encourage you to take a hard look at it for your testing framework.

Wednesday Day 3 - #FindPhillip

Full schedule: https://2014.event.springone2gx.com/schedule/2014-09-10

On Wednesday we started a #FindPhillip campaign on Twitter that would earn people a coffee mug for finding me at the conference:

A few people capitalized on the opportunity!

My schedule for the day

I also had the opportunity to get some answers to pressing questions that I had from some of the Spring folks about how they support backwards compatibility. Specifically:

Q: How can you support Java 8 features like @Optional and the new DateTime API while maintaining compatibility back to Java 6?

A: It turns out that using those APIs specifically does not change the type of the underlying bytecode. Only if you use something like a lambda expression does it change the bytcode to something that is not Java 6 compatible. For that reason, Spring cannot utilize lambdas within the Spring Framework but they can build a jar that references Java 8 classes.

Q: How can you support different 3rd-party frameworks in a single Spring version? For instance, how can you maintain compile-time compatibility between Hibernate 3 and Hibernate 4 in a single version of Spring? Same with Jackson 1 and Jackson 2?

A: In regards to Hibernate specifically, Spring duplicated classes that reference compile-time dependencies for different versions of Hibernate and then split them into different projects. At the build phase, each separate Hibernate version is compiled and the final class files are merged together and bundled into a single jar (using the Gradle equivalent of the Maven Shade plugin). At this point you have all of the compiled class files for both Hibernate 3 and Hibernate 4 support in a single jar. Then the implementing user is the one that selects Hibernate 3 or Hibernate 4 by adding a LocalSessionFactoryBean instance from either the hibernate3 package or the hibernate4 package.

Both of these cases are only made possible with the fact that while some application servers do scan all class files in lib jars, these application servers do not scan inner classes, nor does it actually check anything about an import statement. Thus, Spring can add unique inner classes that utilize Java 8-specific classes (like the Datetime API) without requiring users to also adopt Java 8.

Another general strategy for supporting backwards compatibility is to perform a Class.forName() lookup and then set a static property within a class (like jackson2IsPresent). This static property can then be used to determine which version of an API to use.

Thursday Day 4 - Upgrades == Good

Full schedule: https://2014.event.springone2gx.com/schedule/2014-09-10

Today was my talk. I was a little nervous, especially with the turnout!


My talk focused on software upgrades in general and a demo of utilizing a new Spring 4 feature in an existing application. Specifically, I gave a demo of using Web Sockets to send notifications to users when a product is purchased. Here is the demo implementation in action:

socket demo

The entire talk was recorded and I will post it here once it is published.

Final thoughts

This was a great conference and I highly recommend others that are using Spring to make it out. While all of the talks were great there is a huge amount of value to simply talk to others that are using Spring. Some of the stories that I heard of people finding new and interesting ways to utilize all of the different Spring talks was inspiring.

A huge thanks to Pivotal and No Fluff Just Stuff for putting on such a great conference and picking up the tab in Dallas for speaking! Hope to see you next year in Washington, D.C.!