days
-4
-1
hours
-1
-4
minutes
-2
-7
seconds
-2
-3
search
The week in Java

Java Weekly 34/15: Optional, Valhalla, Docker Toolbox

Thorben Janssen
News image via Shutterstock

This week’s Java news by Thorben Janssen stars Project Valhalla, improvements to the Docker Toolbox and using the new Java 8 Date and Time API with Hibernate. All this and more when checking out the week’s hottest Java links.

This post originally appeared on Thorben Janssen’s Java EE blog, where Java news is published weekly: thoughts-on-java.org.

Matt Raible did an interesting interview with Kirk Pepperdine about the RebelLabs’ Developer Productivity Report in which Kirk talks about the results of the survey and his own opinion on performance testing.

There were quite some discussions about the best way to use Java 8 Optional in the past and you could read opinions from “you should use it always” to “you should never use it”. Stephen Colebourne added a good post to the discussion in which he describes his very pragmatic approach. He suggests to use Optional only for getters and business logic methods that may return null. You can read a more detailed explanation of it in his post Java SE 8 Optional, a pragmatic approach.

Implementing mapping code for value objects is one of the most boring and annoying tasks in development. One way to get rid of it is to use MapStruct, a framework which generates mapping code at build time. Wojciech Hildebrandt wrote a nice introduction to this handy framework: Don’t get lost, take the map! – DTO survival code.

Java offers several different garbage collectors and with Java 9, the G1 collector might become the new default. Geoffrey De Smet took this as a reason to benchmark the existing Java 8 GC implementations with his OptaPlanner application and found out that he wants to keep the parallel GC for his application.

Future Java Versions

Brian Goetz gave the interesting talk called “Adventures On The Road to Valhalla” at the JVM Language Summit 2015 about Project Valhalla. This project targets two major topics: value types and generic specialization. If you prefer the written word over a YouTube video, you should have a look at Nicolai Parlog’s summary of the talk.

Java EE

There is one big issue if you want to use the new Java 8 Date and Time API with Hibernate. There is no real support for it. Hibernate just maps it to a BLOB. If you want to store it as a DATE or TIMESTAMP in the database (which you absolutely should do!), you need to implement the conversion yourself: How to persist LocalDate and LocalDateTime with JPA.

This and that

If you are using Windows or Mac OS, getting started with Docker in development has often been quite difficult. This will hopefully improve with the new Docker Toolbox which was announced on the Docker Blog as a replacement for Boot2Docker.

Recordings

The JVM Language Summit took place this week in Santa Clara with quite some interesting sessions about future Java changes. You can watch the recorded sessions on YouTube: JVM Language Summit 2015.

Upcoming events

On Wednesday, August 19th at 4pm UTC, Gleb Smirnov will talk about Java concurrency in his talk “Java Concurrency Under the Hood” at the vJUG.

Eugen Paraschiv will give a webinar about “CQRS and Event Sourcing with Spring” on August 19th at 3pm UTC.

Author
Thorben Janssen
Thorben is a senior developer and regular Java blogger with more than 10 years of experience in Java EE development and architecture. During these years he has acted as developer, architect, project and technical lead to create high available, clustered mobile billing solutions and laboratory information management systems.

Leave a Reply

Be the First to Comment!

avatar
400
  Subscribe  
Notify of