aspose file tools*
The moose likes Groovy and the fly likes Anyone already uses Groovy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Anyone already uses Groovy" Watch "Anyone already uses Groovy" New topic
Author

Anyone already uses Groovy

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9377
    
    2

Guys,

Out of your Groovy user experience, can you guys please post the pros and cons of using it simultaneously with Java?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
We use it as an embedded scripting language for our reporting platform that is written in Java, and it's working quite well. There are some minor pitfalls, some differences that you need to get used to - such as the way return values are handled, and some later features still missing from Groovy (such as varargs). But in the end, I think it was the right decision.


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9377
    
    2

Good to know. Thanks!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9377
    
    2

How is the community looking at it when building Enterprise apps?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by Jothi Shankar Kumar Sankararaj:
How is the community looking at it when building Enterprise apps?


I don't think I understand the question. Can you please elaborate? Thanks!
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9377
    
    2

I meant to say, when we have a new software or a new version of the existing software, it takes some time for the community to really adopt it. For some softwares which are really attractive, the adoption rate is much higher and it penetrates like anything to be widely used as soon as it is launched. So in this sense, how good the community is responding to the usage of Groovy in commercial enterprise projects?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Frankly, I don't know. Perhaps someone else can answer this...
Raj Chila
Ranch Hand

Joined: Mar 18, 2004
Posts: 128

I stumbled across Groovy while I was looking at 'canoo' on Hudson.

Frankly I dont yet know or have seen a need for using Groovy yet, but here are some questions I would like to ask.

1. How different is it from BeanShell?
2. I have briefly looked at the syntax and it looks like memorizing a completely new language in contrast to beanshell where you could use the same java syntax.

Ilja, I am sure you must have evaluated alternatives, can you elaborate why Groovy?
[ July 13, 2008: Message edited by: Raj Chila ]
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
1) I don't know much about BeanShell, but it seems that your second question already answered this one.

2) I would summarize our reasons as

- Groovy being the "official" scripting language for Java
- it having a couple of language that make it seem potentially worthwhile to learn a new language, and
- learning a new language from time to time being fun and a good idea
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Originally posted by Raj Chila:
2. I have briefly looked at the syntax and it looks like memorizing a completely new language in contrast to beanshell where you could use the same java syntax.

This is not true about Groovy. You can make your Groovy code look as much like Java as you wish. But if you want to avoid the clunky, messy, extra syntax of Java, you can make your code better by switching over to some of the Groovyisms that make the language more powerful.

In this respect, it is much like BeanShell. However, the Groovy documentation focuses on what's newly available while the BeanShell documentation for some reason stresses how to do things exactly the same way as Java.

I'm currently using Groovy (and Grails) in an SOA application. It's been terrific.


A good workman is known by his tools.
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Here's a result of a search for groovy & java on monster.com.
Raj Chila
Ranch Hand

Joined: Mar 18, 2004
Posts: 128

Thanks Ilja and Marc,

"Learning a new language from time to time being fun and a good idea"

I Surely agree with that..and every new language or versions of it evolve because they are better or give us more 'ability' to do things better and do more with little code.

It is good to know that syntax is not an issue Marc. From the adaptability point of view, I would surely like to go with java like syntax and get more and more Groovy while I am at it. and also thanks for sharing the link.
Matthew Taylor
Rancher

Joined: Jun 13, 2004
Posts: 110
Originally posted by Jothi Shankar Kumar Sankararaj:
I meant to say, when we have a new software or a new version of the existing software, it takes some time for the community to really adopt it. For some softwares which are really attractive, the adoption rate is much higher and it penetrates like anything to be widely used as soon as it is launched. So in this sense, how good the community is responding to the usage of Groovy in commercial enterprise projects?


You might be surprised to find out that the enterprise application you are working on already has some Groovy code in it! Groovy can be embedded into an Ant build file, with some really powerful results (if you don't want to move to Gant. It is so easy to add the Groovy jar to the project classpath, it's possible that no one would even notice it was there.


Grails Consultant
http://dangertree.net
Jason Mayer
Ranch Hand

Joined: Oct 16, 2007
Posts: 31
I just wanted to mention that when I first started writing groovy code, I tended to write it in standard java, and later groovify it. So no, there is no "new syntax". It's standard Java (without the pain). That said, I tend to write straight groovy code now without the Java pain.

I wrote this sample for you all. It demonstrates some of the nicer features of the language I think.



Frankly, I love this language. It's a nice transition towards a more modern language for us Java folks who couldn't get Ruby approved in the workplace a few years ago.
[ October 22, 2008: Message edited by: Jason Mayer ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Anyone already uses Groovy