Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are use cases for Groovy Scripting besides Java / Groovy classes? [closed]

I am playing around with Java, Groovy and Scala at the moment. Groovy enables to write scripts besides classes, which is often stated as a big advantage of Groovy because you can write applications and scripting with the same language.

Can you please tell me some use cases where it does make sense to use Groovy scripts?

For me, a script is something like unix shell scripts which copy files or stuff like this. Besides, I use JACL and Jython scripts for WebSphere Application Server deployments.

My question: When should I use Groovy scripts? Should I use them for copying files instead of unix shell scripts (thus, I have classes and scripts in the same language for easier maintenance) or when else should I use Groovy scripts?

Thanks.

Best regards, Kai

like image 477
Kai Wähner Avatar asked Dec 04 '22 08:12

Kai Wähner


1 Answers

I have found Groovy scripts are great for tasks that change often and benefit from the extensive availability of Java libraries. Their use allows me to respond quickly to dynamic business processes such as data integration with JDBC, file transfers with Apache Commons, and encryption with BouncyCastle.

like image 87
James Allman Avatar answered Dec 06 '22 10:12

James Allman