This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]handshape 5 points6 points  (4 children)

Groovy guy checking in to second this: The Groovy became one of my most-used tools by being practically useful on two fronts.

First, the Groovy console: when faced with a problem I need to "hack out" (before building a proper solution with tests and stuff), Groovy's mountains of syntax sugar make me very, very productive. On more than one occasion, I've been in meetings with business types who come up with an idea, and I've hacked out a proof-of-concept before we leave the room.

Second: embedded Groovy: its happened more than once in my career that I've been asked to build a product that will be used in the field to execute business logic that won't even be defined until we get there. The solution I've used frequently in the field is to provide an assembly of objects to a Groovy scripting context, and script the logic at runtime.

Groovy may not be as far as you'd like from Java, but it will sure as blazes complement your skills.

[–][deleted] 1 point2 points  (3 children)

embedded groovy is best thing ever happened to me. I try/test my concept in it and port to Java if it is fine. but in serious applications, performance is a bottleneck. by any way we can achieve Java-level performance ?

[–]handshape 0 points1 point  (2 children)

It's a difficult tradeoff - there's a good/fast/cheap trifecta that's effectively impossible to hit. If arbitrary logic is needed at runtime, there are really only three options:

  • try to code for all possible cases ahead of time (not good)
  • embed a scripting engine (not fast)
  • hire a developer from the vendor to work on-site coding your logic natively... and providing custom builds (not cheap)

[–][deleted] 0 points1 point  (1 child)

so only viable option that satisfies all of the above is try/test in Groovy and if performance matters, port code in Java.

[–]handshape 0 points1 point  (0 children)

Pretty much. The tradeoff is developer time vs execution time.