Many of the script engines available today provide more features to developers than just simple script evaluation. One such feature is the ability to call standalone functions and object methods defined in the script. In some languages you can even implement whole Java interfaces in scripts and use them in Java as regular objects. As we will see, these features can have a great impact on how you use scripting in your applications--but first, we must see how the Scripting API supports these features.
Read Dejan's post : http://today.java.net/pub/a/today/2007/09/20/scripting-balance-design-performance.html