Groovy is a Java-based "next generation" programming language designed to improve Java while adding popular features from Smalltalk, Python and Ruby. Groovy syntax is a super-set of Java which allows Java developers to begin coding in Groovy as they learn it. Groovy is fully object-orientated, ...

learn more… | top users | synonyms

2
votes
0answers
38 views

Traits, Inheritance and Interfaces in Groovy, when to use them?

I'm learning groovy and I've just learned about the new feature added in 2.3, which is the addition of Traits. Now to me it seems like Traits allow you to do basically everything a super-class and an ...
3
votes
2answers
261 views

Speed difference between VM-based and compiled code [closed]

Not so long ago I was told by a senior academic that, these days, VM-based code could run nearly as fast as compiled code, but my own experience is that compiled code runs several orders of time ...
2
votes
1answer
127 views

Moving business logic from services to classes?

I have a Grails application with a number of services that are starting to get very large. The flow in the majority of my service methods is Database read (Returns DBCursor from MongoDB) Iterate ...
1
vote
1answer
204 views

Best practice for comments above methods in a grails application?

I'm writing a grails application and am not sure what the best practice is with regard to comments outside of method blocks. I've done a bit of research and there seems to be conflicting views on how ...
5
votes
4answers
915 views

Make methods that do not depend on instance fields, static?

Recently I started programming in Groovy for a integration testing framework, for a Java project. I use Intellij IDEA with Groovy plug-in and I am surprised to see as a warning for all the methods ...
12
votes
4answers
3k views

What is the difference between a Future and a Promise?

What is the difference between a Future and a promise? (In Akka and Gpars.) They look the same to me as both block and return the value of the future when get is called and a promise is to get the ...
2
votes
1answer
144 views

What's the computational complexity of the Groovy unique() method?

Question 1 What's the computational complexity of the Groovy unique() method? Question 2 How could I have figured it out by myself? The unique() method is defined in the class DefaultGroovyMethods. ...
3
votes
2answers
871 views

Testing Java as Groovy

We're looking into improving our testing process for some of our applications, and the idea that's been put forward it to write unit tests in Groovy and automatically run them with Maven. The first ...
8
votes
4answers
815 views

What's special about currying or partial application?

I've been reading articles on Functional programming everyday and been trying to apply some practices as much as possible. But I don't understand what is unique in currying or partial application. ...
2
votes
2answers
244 views

New insights I can learn from the Groovy language

I realize that, for a programmer coming from the Java world, Groovy contains a lot of new ideas and cool tricks. My situation is different, as I am learning Groovy coming from a dynamic background, ...
13
votes
4answers
780 views

Does groovy call partial application 'currying'?

Groovy has a concept that it calls 'currying'. Here's an example from their wiki: def divide = { a, b -> a / b } def halver = divide.rcurry(2) assert halver(8) == 4 My understanding of what's ...
4
votes
3answers
2k views

When to write an explicit return statement in Groovy?

At the moment I am working on a Groovy/Grails project (which I'm quite new in) and I wonder whether it is good practice to omit the return keyword in Groovy methods. As far as I know you have to ...
4
votes
3answers
161 views

What class structure allows for a base class and mix/match of subclasses? (Similar to Users w/ roles)

I have a set of base characteristics, and then a number of sub-types. Each instance must be one of the sub-types, but can be multiple sub-types at once. The sub-types of each thing can change. In ...
0
votes
1answer
677 views

What's the best practice for rendering a different GSP template based on the type of object in a collection?

Let's say I have a collection that is setup in my controller, named "things." In this collection is a heterogeneous assortment of objects. Let's say some are of type "Thing" and some others are of ...
-1
votes
1answer
783 views

Pros and cons of using Grails compared to pure Groovy

Say, you (by you I mean an abstract guy, any guy in your team) have experience of writing and building java web apps, know about filters, servlet mappings and so on, and so on. Also, let us assume ...
16
votes
1answer
361 views

Does Groovy follow Tennent's Correspondence Principle?

Here's an interesting discussion of Tennent's Correspondence Principle, and a brief description from Neal Gafter: The principle dictates that an expression or statement, when wrapped in a closure ...
27
votes
5answers
13k views

Is Groovy going away? [closed]

I am sure this question has been asked many times. However, I like to ask it again with the intention of what is the future of these languages. I was first introduced to Groovy and really liked it. I ...
3
votes
4answers
5k views

Learning Groovy vs learning Python, Ruby or Perl to get some insight on dynamic languages programming

I would like to explore programming in dynamic languages, and I found that Groovy would be really easy to learn because it is heavily based on Java. won't I miss anything important regarding dynamic ...
6
votes
2answers
1k views

How difficult would it be to migrate a Struts/JSP application to Groovy?

I have taken over development of a JSP/Struts application. Right now it's a bit of a mess, and I'm finding the JSP pages with Struts tags to be insanely verbose. Has anyone migrated a Struts ...
8
votes
5answers
3k views

Is there a clear leader amongst JVM-based languages? [closed]

What is the current status of these projects, and has any one (or two) emerged as a clear leader? To demonstrate my motives for asking this question, cast your mind back several years. Prototype and ...
12
votes
4answers
849 views

Pitfalls in the Grails Framework

What are some of the biggest issues/pitfalls with using the Grails framework? I'm learning the framework now, and I really like it, but I need to know what major issues I may encounter when using it ...
1
vote
3answers
2k views

Advantages of Scala vs. Groovy with JAVA EE 6 Applications

Please let me first emphasize that I am not looking for flame wars. I just want advice from people who have real experiences. I started learning JAVA EE 6 as real newbie and am having a difficult ...
1
vote
1answer
260 views

Groovy/Grails course content

Some Java developers have asked if I could give them a 2-day primer on Grails development. I'm assuming they're familiar with: Java language and libraries Java web development, e.g. Servlets, JSPs ...
19
votes
14answers
8k views

Java devs: why not use Groovy? [closed]

OK, so there are quite a few people using Java these days. But as the language nears two decades of age, it isn't exactly the coolest option out there. Many of us are excited about dynamic languages ...
5
votes
3answers
3k views

Jython and JRuby vs. Groovy (and Java) [closed]

I am very interested in Python for programming on the JVM, and I've worked in Java and Ruby (not JRuby) a lot, and to a certain extent in Groovy. What are the limits to the Java-Jython and Java-JRuby ...