• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can Groovy replace Java?

 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Dierk König
author
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's great and it seems quite obvious .

Thank you Mark!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic