|
From: Rod J. <ro...@in...> - 2004-10-02 16:49:48
|
Ugo The beanshell support does implement property setters. The problem is that beanshell can only provide a dynamic proxy, implementing one interface at a time. So my solution was to use CGLIB InterfaceMaker (suggested by Chris Nokleberg on the Spring forum) to create an interface of setters for every bean property set on the bean definition, and handle this as an introduction with Spring AOP. This is actually a very generic approach, that allows just about anything to be configured by "virtual dependency injection". As for adding Rhino support, scripting overall will go into core in Spring 1.2. The number of scripting languages is high, so it might be good to have a module for additional language support. So ship with only Groovy and bsh, which are both likely to be used elsewhere in the framework, and have a separate module for Jython, Rhino etc. But definitely, it would be great to have comprehensive scripting support for many languages before 1.2! I would want this support to be consistent. For example, the present approach is designed so that all scripts implement the DynamicScript interface, allowing control over forcible reload, auto reload settings. The present code needs refinement, but I'm fairly happy with the overall approach. I assume you've adopted the consistent approach, as you have most of the test cases passing... If you can send me your Rhino code I'd like to take a look. Unfortunately I'm snowed under for at least the next week, but should be able to look at it sometime this month. R -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of Ugo Cei Sent: 02 October 2004 14:07 To: spr...@li... Subject: Re: [Springframework-developer] Groovy/Spring Il giorno 01/ott/04, alle 22:46, Rod Johnson ha scritto: > Look at the beanshell support, also in the sandbox. This creates an > interface from the bean properties, along with an introduction to set > the properties. Your introduction could use whatever API to > "implement" the setters. I looked at the beanshell support, but I don't think it does what I need, that is to provide a default implementation for property setters, or am I mistaken? Besides, all this AOP stuff is pretty new to me, so for the moment I will stick to the current implementation. Would you be interested in adding it to Spring? The only dependency is Rhino's js.jar (700kB) and I have reimplemented most of the testcases that are there for the Groovy version (but defining beans inline is not supported at the moment). In case you are, what is the accepted procedure? Send the files to this list? Post them to JIRA? Ugo -- Ugo Cei - http://beblogging.com/ |