1

The Spring framework supports the use of scripting languages (specifically JRuby, Groovy and BeanShell) whereby a script in any of these can call Java code and vice versa.

I have read that a possible use of this feature is when some modules require frequent changes and it would allow to modify your application without having to redeploy it. I have been trying to visualize a possible usage but this sounds too vague to me. I tend to associate things that can change with configuration, data or rolling a new feature in an application, but not with an existing module whose behavior can change frequently.

In summary: when did you benefit from using Spring scripting or at least what would be a realistic, concrete example?

gnat
20.5k29 gold badges117 silver badges308 bronze badges
asked Jun 9, 2013 at 18:37

1 Answer 1

2

Not a real world example (from my own experience anyway) and I don't use Spring but I think a place where I would consider using something like this.

Think you have some kind of shop software and want a function to calculate shipping costs. Those can depend on quite a lot of factors: free shipping above some order value, national shipping, international shipping, different kinds of faster processing etc, size of order (especially if you are a retailer and shipping may include whole trucks or containers).

You can't fully express those with data, but it's simple enough that the guys in the orders department could handle it themselves instead of asking a developer and having to wait for the next version (or at least the developer can drop in the change without going through the whole QA process required for a full update)

You could come up with a lot of rules that can be expressed with rather simple code in areas that may change very frequently with any kind of new contract made.

answered Jun 9, 2013 at 19:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.