An alternative to exceptions in Java: validations, pt. 1

Exceptions in Java are inconsistent due to their special handling. They are like a separate flow of information, which not only claims extra resources of a developers mind, but also comes with a lot of boilerplate code and high likelihood of new bugs. Instead of exceptions, errors can be handled with »validations«. The underlying concept of a validation offers an effective and consistent approach to error handling and data validation. Even though validations are more than capable of handling any kind of exception, I will focus in this post on data and result validation.

Read more →

The complete picture: Lagom and Play in action (Java)

If you ever came across Lightbend, the driving force behind Scala and Akka, you might also have heard about Lagom and Play.

Lagom and Play fall into the category of reactive microservices. I’ll not go into detail about this, there are plenty of resources out there (e.g. here and on a broader perspective, here). The most important takeaway is that you can build a microservice architecture with Lagom. Play complements Lagom as it provides the web-framework that serves content to the user using Lagom’s microservices in the background.

What puzzles me, though, is that Play and Lagom are handled in isolation when searching for information or going through the tutorials (at least that is my experience).

How can you combine Lagom and Play to set up a complete system?

Read more →