Home » JVM Languages » Groovy

Groovy

Make Your Groovy Objects More Bullet-Proof

Groovy has the Immutable annotation which allows to create immutable classes, which is a prerequisite for creating value objects. Unfortunately, when a class has been annotated with Immutable it’s no longer possible to add your own constructor to verify if provided parameters are not null, which would make our value objects really bullet-proof. @groovy.transform.Immutable class Money { BigDecimal amount } ...

Read More »

Grails 3.3 has Spock 1.1

You’ll be glad to know that milestone 1 of Grails 3.3 has been released 3 days ago — and is also already available through SDKMAN!. Not only has it upgraded its dependencies to Hibernate 5.1.5, Spring Framework 4.3.7, Spring Boot 1.5.3 and Gradle 3.5, but it also finally ships with the latest Spock 1.1 testing framework. Spock is an old ...

Read More »

Grails Anti-Pattern: Everything is a Service

The context Grails makes it very easy to put any logic of your application in a service. Just grails create-service and you’re good to go. There’s a single instance by default, injectable anywhere. Powerful stuff and makes it easy to get up ‘n running very fast! Creating a new application, following so-called “best practices” from blogs like these and the ...

Read More »

Grails Anti-Pattern: Locally Optimized Dynamic Finders Everywhere

The context Grails makes it very easy to persist and find stuff using domain classes. It uses GORM (Grails’ Object Relational Mapping) under the hood, which by default uses Hibernate to map domain classes to tables in a database. Powerful stuff and makes it easy to get up ‘n running very fast! Creating a new application, following so-called “best practices” ...

Read More »

Using Groovy to Quickly Analyze Terracotta HealthCheck Properties

One of the considerations when configuring Terracotta servers with tc-config.xml is the specification of health check properties between Terracotta servers (L2-L2), from clients to server (L1-L2), and from server to client (L2-L1). Terracotta checks the combination of these properties’ configurations in high-availability scenarios to ensure that these combinations fall in certain ranges. This blog post demonstrates using Groovy to parse ...

Read More »

Debugging Grails 3, Spring Boot or Gradle with Eclipse

This is a small post for those who’s primary IDE is Eclipse for developing Grails 3 apps or plugins — and are still wondering how to debug their application. First of all, to clarify: there’s no “Grails” debugging, it’s just Spring Boot and Gradle these days, with Grails 3. Any way to debug these kind of applications allows you to ...

Read More »

Accurest and Stub Runner 1.1.0.M3

Currently at the Spring Team we’re polishing our libraries for the upcoming final release of the Brixton train. It should happen soon :) Until then I’m spending a lot of my after work, free time on Accurest and Stub Runner. Today’s post will be about the new stuff that you will be able to profit from in the upcoming 1.1.0 ...

Read More »

Building GORM Criteria Queries Dynamically

I originally wrote most of the queries in the spring-security-ui plugin using HQL because I find it more intuitive than criteria queries, but HQL only works with Hibernate and relational databases. A pull request updated the queries to use criteria queries to allow the plugin to be used with NoSQL datastores, but one query didn’t fit the programming style that ...

Read More »