Spring Java framework gets a Java 6 upgrade

Improvements like annotations are meant to bolster Spring's standing as a top Java app development tool due to its simplicity and power

Improvements to the open-source Spring Java framework and a companion Web technology being unveiled Monday focus on annotations, scripting, and Java (Java Platform Standard Edition) 6, developers of the framework said.

Officials of Interface21, which oversees development of Spring technologies, will reveal plans for Spring Framework 2.1 and Spring Web Flow 1.1. Both will be available in a release candidate form at the JavaOne conference, which begins in San Francisco on May 8. Final releases are planned for June.

Having been downloaded 3 million times, Spring has become popular for Java application development because it combines simplicity and power and can be used in mission-critical applications, said Rod Johnson, founder of Spring and CEO of Interface21.

Themes around the new releases of Spring and Spring Web Flow focus on ease of use and exposing the products to different categories of users, such as those who want to use annotations heavily.

Spring's accommodations for annotations will probably be the most noticeable improvement, Johnson said. Traditionally, Spring has emphasized the use of XML meta data to externalize configuration data from Java code. But in version 2.1, annotations, which are source-level metadata, can be used.

"Application configuration becomes simpler," Johnson said.

Use of source-level metadata is akin to adding notes to code, such as to a message declaration or a field. "It doesn’t change how the code executes, but it adds metadata that can be used, for example, by frameworks," said Johnson.

The key point is some developers like to use XML, but another camp likes to use annotations, said Neelan Choksi, Interface21 vice president. A third camp likes to mix and match, he said.

Annotations was called "a great time-saver and a good productivity feature," by Brad Shimmin, principal analyst at Current Analysis.

"Annotations have been around for a while, but they're now just starting to really take off, primarily with the introduction of Java EE (Enterprise Edition) 5 and now enhanced through Spring 2.1," Shimmin said. "What they do, which is pretty cool, actually, is they let you describe the use and meaning of different objects."

Java 6 capabilities in Spring 2.1 include out-of-the box support for standard annotations, affecting such capabilities as application configuration and initialization. Also from Java 6 is enhanced ease of use for Java Persistence API, which offers object-relational mapping capabilities for accessing relational data from a Java program.

Scripting functionality in Spring 2.1 adds support for the Rhino implementation of JavaScript featured in Java 6. With Spring, scripting enables developers to quickly apply container services, such as configuration capabilities and declarative transaction management and security.

"You can apply all those capabilities to components written in any of the supported dynamic languages," Johnson said. Spring developers thus get the advantage of the Spring component model and the greater ease of use offered through scripting, he said.

Also featured in Spring 2.1 is support for Java Component Architecture for advanced integration between Java applications and systems like mainframes.

Spring Web Flow is a Web technology for setting the flow of interactions in applications, particularly in e-commerce systems. An example would be setting up a series of steps for booking a seat on an airplane. Featured in version 1.1 is significantly enhanced integration with JSF (JavaServer Faces); developers get the full power of the Web flow model, Johnson said.

"The benefit of that is that JSF provides a standard component model for Java Web development," said Johnson. JSF is becoming increasingly popular and serves as an alternative to the more traditional template-based approach to Web development, he said.

Spring and Spring Web Flow are offered via an Apache license.

Copyright © 2007 IDG Communications, Inc.