So I've been doing some thinking lately about dependency injection, and the fact that my own personal beef with it (other than the amount of dogma surrounding it) is the fact that dependencies are exposed through the public interface of the class. This has always seemed wrong to me.

Anyway, after a little push from Nic to make the @Before/@After stuff work with non-public methods, I figured why not do the same for the Spring integration? And actually I've gone on a bit of a rampage and refactored the SpringHelper quite significantly. I've made the following improvements:
        - support for protected/package/private method access as well as public
- support for public/protected/package/private *field* access (if you annotate the field) - support for non-standard method naming (e.g. @SpringBean someBean (Bean bean) will look for "someBean" in the ctx)
        - caching of discovered fields/methods for injection per class
- catches all Spring exceptions and provides more information in a rethrown exception - more up front checking of method signature and informative exceptions
        - injectBeans(Object, ActionBeanContext) the original method signature
- injectBeans(Object, ServletContext) looks up a web application context and uses that - injectBeans(Object, ApplicationContext) uses the spring context supplied

I've also written a fairly exhaustive unit test that covers all the positive and negative cases I could think of (even threading tests thanks to TestNG's super-easy multi-threading support). And of course, it's backwards compatible (at least in terms of positive test cases).

That said, I don't actually use Spring in any of the applications I'm developing currently. Anyone game for trying out the latest spring support and providing feedback? It'll be in SVN a few minutes after I hit send on this email...

-t




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development

Reply via email to