First Spring 2.0 Release Candidate is Out
Configuration SimplificationThe documentation has also been significantly improved.
- Bean definitions based on XML schema, with out-of-the-box XML namespaces for simplifying common configuration tasks
- Support for extended bean scopes in application contexts, with web request and session scopes as main targets
- Bean definition enhancements: lazy loading of bean classes, collection merging, and intelligent error messages
Persistence and JPA
- Simplified AOP configuration based on XML schema namespaces
- Support for AspectJ pointcut expression language and @AspectJ-style aspects
- Support for dependency injection on any object, including fine grained domain objects (based on AspectJ)
Scheduling and Messaging
- Enhanced JDBC support: named SQL parameters, generics-based SimpleJdbcTemplate
- Explicit support for Hibernate 3.1 and 3.2 (while remaining compatible with Hibernate 3.0)
- Support for the Java Persistence API (JPA), including the full container contract with class instrumentation
Web Application Development
- TaskExecutor abstraction for submitting asynchronous work
- Support for various thread pools, such as a Java 5 ThreadPoolExecutor and a CommonJ WorkManager
- Support for asynchronous JMS ("Message-Driven POJOs") based on message listener containers
- Conventions-based web MVC: controller mappings, model attribute names
- JSP form tag library for use with Spring Web MVC and Spring Web Flow
- Full support for Portlet environments, including Portlet-style MVC based on a DispatcherPortlet
As reported by InfoQ in the must read Spring+JPA to be the next popular stack?, Spring 2.0 now provides the complete EJB container contract for JPA, allowing JPA to be used under a Spring managed services layer (with all the AOP and DI richness of Spring) in any environment. Debates are already beginning about whether the next defacto stack will be EJB, Spring+Hibernate, or Spring + JPA. By implementing the ejb container contract, Spring allows the injection of the persistence across components in the same transaction, as well as the ability to have components join transactions and also support for extended persistence context. Spring 2 thus allows the use of JPA with all the features supported within a container.
The new PetClinic sample application is available in the Spring 2.0 distribution under /docs/samples showing running over TopLink essentials (the JPA reference implementation). According to Rod Johnson, the PetClinic was partially authored by Mike Keith, EJB co-spec lead and TopLink Essentials lead at Oracle. Rod also mentioned that Interface21 will likely be applying to join future versions of the JPA spec.
Solomon Dusksis has also recently blogged about Spring 2.0 support for scripting languages.
See also: Pitchfork: EJB 3 Interception & Injection to WebLogic using Spring, and other InfoQ content about Spring, including the free downloadable book Java Transaction Design Strategies which illustrates transaction management in EJB and Spring.
Ralph Winzinger Nov 25, 2014