SpringOne 2008 - Spring 2.5 on the way to 3.0 by Jürgen Höller

Part of this talk overlapped with Rod's talk, but Jürgen could go in more detail.

Spring is aligning itself with modern standards / APIs:
  • JDK1.6 support: e.g. JDBC 1.4, with better LOB handling
  • support for JMX and MXBeans
  • AspectJ loadtime-weaving --> avoids proxy pitfalls; support "new" operator
  • JEE5: Servlet API 2.5 & JAX-WS
"Self-describing classes" with annotations, removing config. As a general rule, annotations should be descriptive; even if a compiler ignores them (e.g. in tests), they should add documentation to the class:
  • JSR 250 @PostConstruct & @PreDestroy: quick wins: explicit initializers
  • JSR250 @Resource on steroids: standard is JNDI-only, but spring also resolves spring-bean names.
  • @Autowired (& @Qualifier for more specific rules): elegant way to minimize xml-config, while keeping fine grained control over the DI. It's not an all-or-nothing: mix&match between xml and @autowired makes sense.
  • autodetectable components with: @Component. Without declaring a bean, the component automatically becomes available in the spring context.
  • @Configurable (AspectJ) --> use regular new operator and benefit from Spring config! (load-time weaving)
  • "@MVC": No need to extend a MultiActionController anymore: with @Controller and @RequestMapping, the multi-action controller is now the recommended MVC-way, using simple POJOs. It relies extensively on standard naming of classes and methods to interpret URL paths. But, of course, this can be tweaked to the extreme. Even method-parameter names can be used for auto-passing request params if you built your classes with debug-info enabled. Gr8!
  • decide what you prefer: 'externalized' xml config complemented with annotations or fully annotated components with embedded config. As usual Spring doesn't impose one view. The xml-config can, for example, be interesting for a service layer, while the MVC-layer could prefer the annotations.

Spring 3.0

  • Milestone 1: 8/2008 ???
  • Java5+: generics & varargs;
  • extensive use of Expression Language (cfr WebFlow)
  • remove deprecate stuff like commons attributes
  • WebSpere 6.1
  • Rest support

No comments: