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

can Groovy replace Java?

Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Hello Dierk Koenig,

Having said all the facts about Groovy that it is built on top of JVM and its a kinda wrapper to Java, can Groovy replace Java?

As generally the descendant can provide much more facilities over the ancestor with ease, it generally can be a good replacement. How far Groovy has to go? Or can both Groovy and Java compete the race individually?


Thanks,
Raghavan alias Saravanan M.


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Dierk König
author
Ranch Hand

Joined: Nov 01, 2006
Posts: 43
Originally posted by Raghavan Muthu:

Having said all the facts about Groovy that it is built on top of JVM and its a kinda wrapper to Java, can Groovy replace Java?


The purpose of Groovy is not to replace Java but to enhance your Java projects where Java is just too heavy, to cumbersome, or too static.

Groovy provides its benefits at the expense of runtime performance (although this hit gets smaller and smaller). So for high-performance number crunching you may want to write performance critical sections in Java even if say the user interface, application logic, database storage etc. is written in Groovy.

The main benefit of Groovy here is that it integrates so seamlessly with Java.

keep groovin'
Dierk
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Thank you Dierk.

Originally posted by Dierk K�nig:


Groovy provides its benefits at the expense of runtime performance (although this hit gets smaller and smaller). So for high-performance number crunching you may want to write performance critical sections in Java even if say the user interface, application logic, database storage etc. is written in Groovy.



In such case, how exactly the seamless integration might go? The leveraging of Groovy in Java applications? I am just confused at this step!
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Originally posted by Raghavan Muthu:
In such case, how exactly the seamless integration might go? The leveraging of Groovy in Java applications? I am just confused at this step!

Groovy and Java both compile down to the same byte code, so you get the advantage of calling Java classes from Groovy classes and Groovy classes from Java classes. Your code won't know the difference.


A good workman is known by his tools.
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

That's great and it seems quite obvious .

Thank you Mark!
 
wood burning stoves
 
subject: can Groovy replace Java?