File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Groovy and the fly likes Refactoring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Refactoring" Watch "Refactoring" New topic
Author

Refactoring

John Tangney
Greenhorn

Joined: Jun 22, 2008
Posts: 3
In the staid old world of Java and C#, we have some very solid refactoring tools. Combined with solid unit tests, we can whip code into shape and make evolutionary design changes. Of course you can refactor "by hand" but tools are what enable us to make fast, safe changes to our code.

But what about Groovy? Are there any refactoring tools at all?

--johnt

John Tangney
JD Tangney and Associates
http://jdtangney.com
skype: jdtangney
Dave Klein
author
Ranch Hand

Joined: Aug 29, 2007
Posts: 77
Tool support for dynamic languages may never be quite as good as that for static languages, but it is coming along. IntelliJ IDEA, NetBeans, and SpringSource Tool Suite (Eclipse) all provide some automated refactoring for Groovy code. I believe IDEA still has the lead in this area but the others are catching up.

I've found that with Groovy code, and especially with Grails, I don't need to do as much refactoring as with Java code. And when I do, it's easier to see what's what and what needs to change. There's a lot less noise in my code. I personally, rarely use an IDE and I'm getting much more done in less time than I did using Eclipse or IntelliJ IDEA on JSF/EJB projects!

Just my $0.02

Dave
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

I have found Netbeans make Groovy and Grails much easier. I have not tried STS for Eclipse as yet but Netbeans has picked up most of the features listed above and it is "free"


===Vyas Sanzgiri===
My Blog
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15300
    
    6

Vyas Sanzgiri wrote:I have found Netbeans make Groovy and Grails much easier. I have not tried STS for Eclipse as yet but Netbeans has picked up most of the features listed above and it is "free"


Why did you put the word free in quote?

I find Intellij's refactoring of Groovy code pretty atrocious. Most times it tells me that the refactoring is too complex so it can't continue. Which means some of my code is refactored and some is not. Don't get me wrong, i still think Intellij has the best groovy/grails support to date (although I haven't tried the latest Netbeans). But don't expect superb refactoring, for reasons that Dave mentioned.


GenRocket - Experts at Building Test Data
Vyas Sanzgiri
Ranch Hand

Joined: Jun 16, 2007
Posts: 686

Try it - Netbeans has come a long way. We are using it for enterprise development since the last 4 yrs and loving it. They have a great community and excellent if not the best support for Groovy and Grails.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Refactoring