This chapter covers
- Embedding Groovy in Java projects
- Securing user-defined scripts
- Customizing the runtime context
In the programming-language world, one rule of survival is simple: dance or die. It is not enough to make a beautiful language. You must also make it easy for programs written in your beautiful language to interact with programs written in other languages.
Simon Peyton Jones
One of the biggest advantages of Groovy (even one of the reasons for its inception) is that it integrates natively with Java because both languages run on the same platform and for the most part share the same commonly used data structures like lists and maps. It’s important to understand what makes Groovy such an attractive option when you need to embed a scripting language in your application.
From a corporate perspective, it makes sense to build on the same platform that most of your projects are already running on. This protects the investment in skills, experience, and technology, mitigating risk and thus costs.