Spring and Jython — what a combo!

I’ve been thinking off and on for a few month that using Spring inside of Jython would be a magical thing. You could just get a Spring ApplicationContext, call “getBean” and Jython (who doesn’t care what kind of object it is) would happily go on it’s way.  No importing a ton of object — just magic.  Surely it’s not that easy.

Well, this weeks I finally got an opportunity to do so. I’m working on a Spring-based application and I needed to write a script to setup some test data for my stuff.  So I broke Jython out and away I went.  But was it that easy?  Why yes — that was all I had to do! 

Of course, this isn’t Jython-centric.  Any of the JVM-based dynamic languages would have this.  Groovy, JRuby, Beanshell . . .

I’m sure others have already done this before, but I think it’s really cool.


Powered by ScribeFire.

Leave a Reply

You must be logged in to post a comment.