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?
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.
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!
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.