Effective Java with Groovy

Collection of blog posts on how Groovy improves the developer experience of implementing Effective Java practices. GR8Conf EU TalkWhen float and double put you in trouble!Are you implementing equals and hashCode correctly?Favour Internal IteratorsEnabling OrderThe (in)famous nullImmutability…

What's in Groovy for Functional Programming

Collection of blog posts on functional programming with Groovy. ClosuresHigher order functionsCurryingFunction compositionPure functionsImmutabilityRecursionTail call optimisationMemoizationCollect - map operationFilterReduceMap filter reduceStrategy patternCommand patternExecute Around pattern…

Micronaut Dependency Injection - The stand-alone Setup

In this post, let's explore how to use Micronaut as the Dependency Injection container in a stand-alone Java application. Let's start by creating a stand-alone Java application. I make use of the initialisers provided by Gradle (gradle init command). The application structure looks as follows. ➜ microdemo tree . ├── build.gradle ├── gradle…

Groovy Scripts - Reusable Code

Let's start with the following Groovy script which reads and prints all the properties from a file. import java.nio.file.Path Properties loadProperties() { Properties properties = new Properties() Path propertyFilePath = Path.of('my.properties') propertyFilePath.withInputStream { properties.load(it) } properties } Properties properties = loadProperties() properties.each { println it } The script needs…

Continuous Delivery vs Continuous Deployment

There is a good chance that you would have had several debates on what is the difference between 'Continuous delivery' and 'Continuous Deployment'. I have spent several hours discussing this with different groups. Usually, 'Continuous Delivery' implies keeping your software in the releasable state for every commit so that you…

Effective Java with Groovy - Immutability

It would seem like mutability is the default design approach when it comes to Java. However, reading "Effective Java" makes you change your mind. The book suggests - 'minimise mutability'. Also, what is highly useful is the reason for favouring immutability - "immutability is simple". Did you get surprised? Now,…

Micronaut as Dependency Injection Provider

If you are already familiar with Micronaut, most probably you know it as a framework for developing microservices-based applications. Micronaut support JVM languages Groovy and Kotlin in addition to Java. One of the less known facts about Micronaut is that it can also be used as a dependency injection capability…

Effective Java with Groovy - The (in)famous null

If you have seen some of the enterprise applications written in Java, you know the amount of code goes into performing null checks. The 'null reference' feature of Java for sure is the #1 contributor to employment generation. The creator of null reference has already admitted that it was a…