Martin Klang | 29 May 2006 13:41

Spring 2.0 integration

Hi again!

Question: anyone on the list using Java Spring [1]?

It's a pretty cool IOC framework (Inversion of Control, aka 'the  
Hollywood principle'), which basically means that you can get the  
benefits of a full application framework without the massive  
overheads (and headaches) that come with traditional J2EE systems  
such as EJBs.
It is based around POJO beans that are tied together with each other  
and the framework using configuration files.

As of Spring 2.0 you can define beans in scripting languages such as  
JRuby, Groovy and Beanshell. This is really rather interesting, as it  
provides a way for developers to mix and match languages, choosing  
the most suitable language for any particular task. In reality things  
might be a bit more complicated, but at least that's how it might  
work. In short, a very nice feature.

Having thought about it for a while I figured I should try to code up  
adaptors to add o:XML as one of the supported languages. It was  
actually pretty easy, even though I don't really know much about  
Spring. All I had to do was create a ScriptFactory that compiles and  
runs o:XML code, and a wrapper to handle function calls. Easy.
The wrapper handles transformations to and from DOM Nodes, so that  
you can pass and receive DOM objects to/from o:XML beans without  
worrying about conversions. Same with primitive types: String,  
Boolean, Number etc.

It's a bit tricky to explain, but if you know Spring you probably get  
(Continue reading)


Gmane