Monthly Archives: January 2015

The future of Groovy

With the recent revelation that Pivotal will stop sponsoring the Groovy and Grails projects after March of this year, I want to give some of my own thoughts on where this leaves the two projects and what their future might hold. I’ll do this across two blog posts, starting with Groovy.

It may come as a surprise, but I feel pretty sanguine about Groovy. That’s not to say that I don’t sympathise with the teams for the situation they find themselves in, but Groovy itself is in a strong position. First and foremost, it’s stable with a solid set of features already there. Recent additions include:

  • Traits
  • Static type checking and compilation
  • Dedicated Android support

As far as I’m concerned, Groovy doesn’t need any major changes in the near term and so it’s not a big deal if its development slows down. It supplements Java well and provides enough differentiation that it’s worth you using Groovy over Java. It’s great for scripting, Spock is fantastic for unit testing, and Groovy works really well with Spring Boot, Ratpack, Grails, Griffon and other application frameworks. And those are just a fraction of its potential use cases.

The language also benefits from an existing open development process, probably because it originated as a collaborative project between people from different companies. So even if the Groovy team is broken up – something I hope can be avoided – I can’t see there being significant disruption. You’re seeing one of the key benefits of open source software: it survives beyond the withdrawal of a key sponsor. You can’t really say that about commercial software. And while Groovy satisfies a need among developers, you can be sure it will thrive and prosper.

To sum up, Groovy has reached a stable place that puts it in good stead whatever the future might hold. It should still be an essential part of every Java developer’s tool chest. Development may or may not slow down, but it will continue. And I have my fingers crossed that Guillaume, Cédric, and Jochen will find new homes swiftly and I hope they manage to stay together as a team.

One final thought: on the last Groovy Podcast (audio-only version) I half-jokingly said that Google would sponsor Groovy. Of course, I don’t know whether that will happen, but in light of Swift for iOS development, I think it’s something that Google should definitely consider. I’m sure a more productive and expressive alternative to Java would be more than welcome within the Android development community and it fits nicely with their use of Gradle for the build system. Let’s see what happens!

The Grails post may take a bit longer to appear as I think there’s more to say for that.

Why Gradle?

Back in my youth, programs used to come as listings in magazines that you copied into the ZX81’s BASIC editor and then ran. How times have changed. Building software has become more complex as the underlying runtimes and platforms have evolved. As a result of that, we have seen an evolution in build tools. I started my working life using Make (for both C++ and Java), before progressing onto Apache Ant and Apache Maven 2. For a brief interlude I even worked with CMake, which I found to be one of the more challenging tools to learn and understand.

Gradle is a recent entrant to the field, and my current build tool of choice. What lifts it above the more established tools, Ant and Maven? This is a question that anyone involved in building Java software in particular should be asking themselves.
Continue reading

Code reuse in micro services

It seems to me that one of the big questions around micro services at the moment is how to share code between the services that make up the overall system. This is important because you should be able to deploy individual services independently of others. So what can you share and how should you do it?

I don’t have a straight answer, but I do have a suggestion for how to think about the problem. Imagine that each service is implemented by teams in different companies, each with their own private source repositories. How would you share code then? For me, the answer is through shared dependencies (JARs of compiled classes in the case of Java). And those shared dependencies should probably only contain utility code such as that provided by commons-lang and Guava (Java examples again).

I guess shared client API JARs could work too if you don’t want to code against JSON/XML directly. The key code that _shouldn’t_ be shared is that related to the internal model of the service. The public API though is not internal.

So, is this a reasonable or even helpful way to look at this issue?