Julien Chastang
Julien Chastang

Reputation: 17794

Groovy gotchas when integrating Groovy code in pre-exsting Java project

We have a large scale Java web application project. I am considering integrating some Groovy code in situations where I think Groovy could reduce our effort. For example, XML parsing and unit testing.

Are there any "gotchas" or negative impacts for this scenario. For instance, perhaps it would make our build much more complicated. I have also heard of compatibility problems.

Upvotes: 2

Views: 612

Answers (1)

Steve Kuo
Steve Kuo

Reputation: 63134

I had a project that was combined Java and Groovy. I used Groovy for processing a text file and Java for Swing UI. Some of the difficulties where:

  • Poor Eclipse IDE support. The Groovy Eclipse plugin is quite poor, there's no support for command completion. Getting Groovy code to build in Eclipse is very very fragile and painful. Word in the street is that IntelliJ support is way better.
  • Maven integration. Also a bit tricky but not as bad as Eclipse.
  • Performance. After getting fed-up with with poor Eclipse support, I reimplemented my text processing in Java and discovered the performance was way faster. For my application, which reads a lines from a text file and looks for data at certain offsets, the Java code ran about 3x faster than Groovy.

For me, using Groovy wasn't worth it. You mileage may vary.

Upvotes: 3

Related Questions