aspose file tools*
The moose likes Groovy and the fly likes How to Make Groovy Apps Java-compliant Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "How to Make Groovy Apps Java-compliant" Watch "How to Make Groovy Apps Java-compliant" New topic
Author

How to Make Groovy Apps Java-compliant

Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

From this thread
http://www.coderanch.com/t/456/Groovy/sell-Groovy-Java-shop
Jim mentioned that all existing Java code will run as Groovy but the reverse isn't true.
Is there some specific guidelines/conventions that we need to follow in order to make Groovy applications Java-complaint?


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
Alaa Nassef
Ranch Hand

Joined: Jan 28, 2008
Posts: 467
I believe that what Jim meant is this. If you take code written in java syntax and put it in a groovy file, it will work, but if you take code written in groovy syntax and put it in a java file, it won't work. Jim was talking about the reason why some companies do not want to use groovy, since they look at it as a foreign language, and that if it doesn't do well, and there are no resources that know groovy, maintaining the code will be a hell. He also commented that this is not entirely true, since the syntax is quiet easy, and that it's going to be easy to pick up.


Visit my blog: http://jnassef.blogspot.com/
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yup. Also I don't think it would be desirable to try to write Groovy that is fully compilable as Java - if you do that, then you're just writing Java, and what point was there to using Groovy in the first place? Well, I suppose you can still use the various Groovy classes, and that's something. But without using Groovy syntax, you're really missing out on the simplicity and brevity that are a main part of the point of the language.


"I'm not back." - Bill Harding, Twister
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

OK, understood
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Make Groovy Apps Java-compliant