Equals, Is, CompareTo, and the Groovy Identity Operator
If you’ve ever tried to determine if Object a is the same as Object b in Groovy, chances are you’ve thought a lot about a == b and a.equals(b) and a.is(b). To appropriately ask this ...
Getting Groovy with Mongo Monitoring
MongoDB does something interesting that we aren’t used to in the Java world – if you use the MongoClient object, it manages the pooling for you on the server side. This is different than how ...
Serializing Groovy Traits with Jackson
Working on a Groovy and Spring Boot project, we encountered a serialization issue on an object that implemented a Groovy trait. The object would be serialized correctly until the JsonFormat annotation was used on one ...
Implement a GraphQL Endpoint in a Groovy App
GraphQL is on the rise as an alternative approach to traditional REST APIs. Created by Facebook, GraphQL provides a better way for the consumer of an API to ask for what they need and get ...
Using Groovy Based Spring Configuration
Introduction The Spring framework began with using XML as the only means for bean configuration. As Spring grew and more features were added to the framework, XML configuration got to be very verbose and it ...
Flirting with disaster: A dangerous use of Groovy’s dynamic method invocation
I learned something interesting about about Groovy recently. I was tasked with building a tool for advanced admin users, to provide them an easy way to run batch jobs. It was designed so that users could point ...
Groovy gotcha: Passing zero arguments to a method that expects one
I was recently adding a parameter to a legacy method, and after updating all the callers of the method, I found that I was still getting a MethodMissingException. That was strange, since the old method ...
Creating a Mocked RESTful Sandbox Server using Groovy
Introduction At my current client there was a request to create a sandbox version of our RESTful web services to allow users to call into the web services and test them out without changing with ...
List of Groovy versions for each version of Grails
Recently when trying to debug an issue I was having in Grails, I found that the root cause was actually a Groovy bug. After checking the bug tracker, I discovered that the bug was fixed ...
Interfacing Groovy (and Java) with Native Libraries
As much as we hate to admit it, from time to time there are benefits to languages that operate outside the JVM. Whether it’s interfacing with hardware or simply being faster compiled code, C/C++ provide ...