Discussions

News: Spring 2.0, an update by Rod Johnson

  1. Spring 2.0, an update by Rod Johnson (16 messages)

    As seen on the Server Side Symposium, Spring 2.0 is a major release that makes the Spring Framework both more powerful and easier to use. In this presentation from JavaPolis, Rod surveys the new features of Spring 2.0, before focusing on two of the most important: the introduction of extensible XML configuration, and significant enhancements to Spring AOP.

    Spring 2.0 allows Spring configuration to be enhanced with custom XML tags, which can provide valuable abstraction for repeated or complex configuration tasks. Rod will show how to define new tags, and how this capability will benefit all Spring users.

    Spring 2.0 makes Spring AOP both simpler and far more powerful, and marks a major milestone for AOP in general. In conjunction with AspectJ 5, Spring 2.0 provides a complete roadmap for AOP usage, from dynamic proxies up to full use of AspectJ weaving, using the same programming model. It becomes possible to use the powerful AspectJ pointcut expression language in Spring AOP, as in AspectJ. Spring AOP can even run AspectJ annotation-style aspects within its proxy based runtime, with the same low cost of adoption as Spring AOP.

    Listen to the podcast and/or view the talk here.

    Enjoy,
    Stephan Janssen

    Threaded Messages (16)

  2. Does aspectj5 still have to use it's own compiler and wrap the jre or has the point-cut expression language been ported to annotations? i saw a demo from Rod recently in london and he seemed to be using annotations through-out.
  3. Spring 2.0, an update by Rod Johnson[ Go to top ]

    You are free to use the AspectJ pointcut language with either Spring AOP (using proxies) or AspectJ (with the compiler). You may find that the proxy approach is easier to get started with, but the compiler approach is definitely faster.

    The AspectJ compiler is built on top of the Eclipse JDT compiler, so you won't be encountering any issues by switching to using ajc instead of/in conjunction with javac.

    Regards,

    Rob

    --------------------------
    Interface21
    http://www.interface21.com
  4. Spring 2.0, an update by Rod Johnson[ Go to top ]

    so no changes are required at runtime? again, can annotations be used for defining point-cuts or are their language extensions still required?

    are there any good tutorials that you'd recommend for aspectj5? i've used aop(including spring aop and aspectwerkz) in the past so i'm not looking for intro-level tutorials.

    TIA
  5. Spring 2.0, an update by Rod Johnson[ Go to top ]

    Pointcuts can be defined using AJ language extensions, annotations or inline in a Spring configuration file - all with the AspectJ expression language.

    Check out http://www.eclipse.org/aspectj/ for a full list of resources. The http://www-128.ibm.com/developerworks/java/library/j-aopwork8/ article written by Adrian Colyer is a good starting point as is his blog at http://www.aspectprogrammer.org/blogs/adrian/.

    Hope this helps,

    Rob
  6. so no changes are required at runtime? again, can annotations be used for defining point-cuts or are their language extensions still required?

    Well, basically you could define "POJO" AspectJ aspects with @Aspect annotations (the language semantics are completely preserved for annotation style aspects) and have those weaved into target types by LTW (laod time weaver) - no precompilation step required.

    You could also use @AspectJ style aspects (with certain restrictions on available advisable joinpoints - method execution joinpoints) to create regular Spring AOP proxies for Spring-managed beans (by using <aop:aspectj-autoproxy/> bean definition)

    Here's good blog by Adrian Colyer: http://www.aspectprogrammer.org/blogs/adrian/2006/01/typed_advice_in.html

    Regards,
    Dmitriy.
  7. Jython support[ Go to top ]

    The collest thing about Spring 2 I´ve found are those scripting features, although seems like currently they support just Groovy and JRuby. Is there any Jython support on the way ?

    Sure, there are already some ways to use Spring with Jython but would be easier to "sell" the idea with an implementation right from the Spring code repository.
  8. Jython support[ Go to top ]

    The collest thing about Spring 2 I´ve found are those scripting features, although seems like currently they support just Groovy and JRuby.

    There is also a BeanShell support.

    Regards,
    Dmitriy.
  9. Jython support[ Go to top ]

    Rodolfo
    Is there any Jython support on the way.
    The dynamic language support in Spring 2.0 is designed to be extensible. It should be relatively straightforward to add Jython support, although AFAIK we have no plans yet in that area. We would love contributions of support for additional languages; one user was planning to add Jython support over a year ago, but never submitted anything.

    Note that all Spring services--DI, AOP, and AOP-based declarative services such as transaction management--are available to any bean, whatever language it may be defined in. Thus the scripting support is fully integrated with Spring as a whole, and Spring 2.0 extends the Spring component model to make it cross-language.

    Rgds
    Rod
  10. Slides from TSSJS 2006?[ Go to top ]

    Hi Rod,

    Thanks for all the good work on Spring 2!

    I am really looking forward to the final release, with full reference documentation. I used the new extensible XML configuration for the first time tonight, using this blog post linked from www.springframework.org, and the source code, to guide me. This will be easier once the reference documentation is fully up to the quality of previous releases. I hope to apply Spring 2 AOP features shortly too.

    It would be great to get the presentation slides from TSSJS 2006. For example, the Spring 2 M3 code base indicates JRuby setters follow the Java naming conventions, but I thought I remembered from the presentation an example which followed the Ruby conventions (set_xxx rather than setXxx). It could just be my bad memory!

    Keep up the great work!

    John Hurst
    Wellington, New Zealand
  11. JavaScriptFactory alpha[ Go to top ]

    We would love contributions of support for additional languages

    I've got a working prototype of a JavaScriptFactory. If you can point me to instructions on how to check it in, I'd be happy to share.

    James Tikalsky
  12. JavaScriptFactory alpha[ Go to top ]

    James

    Please raise an issue for an enhancement (JavaScript support) in Spring's JIRA issue tracker and attach your code. This is the normal way for community contributions to come in.

    Thanks!
    Rod
  13. I've attched the code to issue SPR-1933:
    http://opensource.atlassian.com/projects/spring/browse/SPR-1933
  14. Do Spring team have any plans to support dependency injection thru annotations?
  15. Spring 2.0, an update by Rod Johnson[ Go to top ]

    Do Spring team have any plans to support dependency injection thru annotations?
    We will shortly be releasing an add-on to Spring that supports the JSR-250 annotations. (Sometime between now and Java One.) Also we are working on another add-on that supports the SCA programming model, which has a different set of annotations. Supporting both these models on top of Spring's far more extensive IoC capabilities is relatively straightforward.

    Regards
    Rod
  16. (Sometime between now and Java One.)
    Rod, you mean between now and SpringOne :o)

    -Stephan
  17. SpringOne[ Go to top ]

    Yes, it may be announced in time for JavaOne, but SpringOne will definitely be the place to learn about this and everything else coming in Spring 2.0 and beyond in detail!