Java Cascading Lambdas and Builder Pattern in Java, when 1 + 1 = 3… but not 4

Cascading Lambdas and Builder Pattern in Java, when 1 + 1 = 3… but not 4

The builder pattern is one of many well known design patterns used to manage complexity in our code. In particular, it helps us to separate an object construction from its representation, which is especially useful when we have to construct an object with a large number of fields. But what it doesn’t do well is …

Read Article Read More

Java Java Exception and Lambda Part 2 : Give power back to the compiler

Java Exception and Lambda Part 2 : Give power back to the compiler

In Part 1 of this series we talked about how lamba expressions introduced since Java 8 are mapping to functional interfaces and how the absence of any¬†throws clause in the standard functional interfaces provided in the JDK somewhat opened the door to the idea of exploiting the sneaky throw technique. We also found how dangerous …

Read Article Read More

Java Java Exception and Lambda Part 1 : To go sneaky or not?

Java Exception and Lambda Part 1 : To go sneaky or not?

Saying that there is a raging debate over the Internet among java developers about how to handle exceptions with java 8 lamba expressions might be a bit strong, but there is definitely an ongoing discussion and various points of view on the subject, so in the spirit of adding a little fuel to the fire, …

Read Article Read More