java Spring 3 有哪些新特性(与 Spring 2.5 相比)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3575437/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What are the new Features of Spring 3 (compared to Spring 2.5)?
提问by Lukem
Does someone can tell me what's new in Spring 3 and the difference to two (Spring 2.5 and Spring 3)?
有人可以告诉我 Spring 3 中有什么新内容以及两者(Spring 2.5 和 Spring 3)的区别吗?
回答by Sean Patrick Floyd
Here are some excerpts from the page New Features and Enhancements in Spring 3.0with links to the relevant technologies:
以下是Spring 3.0 中的新功能和增强功能页面的一些摘录,其中包含相关技术的链接:
Java 5
爪哇 5
The entire framework code has been revised to take advantage of Java 5 features like generics, varargsand other language improvements. We have done our best to still keep the code backwards compatible. We now have consistent use of generic Collectionsand Maps, consistent use of generic FactoryBeans, and also consistent resolution of bridge methods in the Spring AOP API. Generic ApplicationListenersautomatically receive specific event types only. All callback interfaces such as TransactionCallbackand HibernateCallbackdeclare a generic result value now. Overall, the Spring core codebase is now freshly revised and optimized for Java 5.
Spring's TaskExecutorabstraction has been updated for close integration with Java 5's java.util.concurrentfacilities. We provide first-class support for Callablesand Futuresnow, as well as ExecutorServiceadapters, ThreadFactoryintegration, etc. This has been aligned with JSR-236(Concurrency Utilities for Java EE 6) as far as possible. Furthermore, we provide support for asynchronous method invocations through the use of the new @Asyncannotation (or EJB 3.1's @Asynchronousannotation).
整个框架代码已经过修订,以利用 Java 5 特性,如泛型、可变参数和其他语言改进。我们已尽最大努力保持代码向后兼容。我们现在一致地使用了泛型集合和 映射,一致地使用了泛型FactoryBeans,并且在Spring AOP API 中也一致地解析了桥接方法。通用ApplicationListeners仅自动接收特定的事件类型。所有回调接口,如TransactionCallback和HibernateCallback现在声明一个通用的结果值。总体而言,Spring 核心代码库现在针对 Java 5 进行了全新修订和优化。
Spring 的TaskExecutor抽象已更新,以便与 Java 5 的java.util.concurrent设施紧密集成。我们现在为Callables和Futures以及ExecutorService适配器、ThreadFactory集成等提供一流的支持。这已 尽可能与JSR-236(Java EE 6 的并发实用程序)保持一致。此外,我们通过使用新的@Async注释(或 EJB 3.1 的@Asynchronous注释)为异步方法调用提供支持。
Overview of new features
新功能概述
This is a list of new features for Spring 3.0. We will cover these features in more detail later in this section.
- Spring Expression Language
- IoCenhancements/Java based bean metadata
- General-purpose type conversion systemand field formatting system
- Object to XML mapping functionality(OXM) moved from Spring Web Servicesproject
- Comprehensive REST support
- @MVC additions
- Declarative model validation
- Early support for Java EE 6
- Embedded database support
这是 Spring 3.0 的新特性列表。我们将在本节后面更详细地介绍这些功能。

