Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.