javascript
Spring4.x新特性
最近項目中準備集成Spring Data Redis,
| 1 2 3 4 5 6 | <dependencies> ????<dependency> ????????<groupId>org.springframework.data</groupId> ????????<artifactId>spring-data-redis</artifactId> ????????<version>1.7.1.RELEASE</version> ????</dependency></dependencies> |
其版本穩定版已經到了1.7.1.RELEASE了,
其需要JDK level 6.0 and above, and?Spring ?3.2.8 and above.
由于之前項目Spirng版本為3.1.1,于是打算升級版本,
上官網看了下,Spring的版本都到4.3.0 RC2了,最新穩定的版本為4.2.6.RELEASE
| 1 2 3 4 5 6 | <dependencies> ????<dependency> ????????<groupId>org.springframework</groupId> ????????<artifactId>spring-context</artifactId> ????????<version>4.2.6.RELEASE</version> ????</dependency></dependencies> |
出于好奇,就想看看Spring4做了哪些改進,畢竟版本號是大改動。
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/
官方的文檔寫的非常的詳細,這里大致的說下吧:
上圖來自Spring官方的文檔,可以看到改進的還是挺多的。
移除相關deprecated packages 和method,增加對Java8的支持、Groovy式Bean定義DSL、對核心容器進行改進、對Web框架的改進、Websocket的實現、測試的改進。
同時還支持泛型依賴注入。
圖2 Spring4 Modules
????圖3??Spring3 Modules
上面的兩幅圖,大家可以仔細對比一下,圖2是Spring4的modules,圖3是spring3的modules。
更詳細的介紹參見官網:#spring-whats-new
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#spring-whats-new
這里順帶提一下ORM
雖然4.2.6里面依然提供了hibernate3的支持,但是官網是這么說的:
Hibernate 3.6.10
The?org.springframework.orm.hibernate3?package will be phasing out as of Spring Framework 4.2. We keep supporting it for the time being; however, we strongly recommend an upgrade to Hibernate 4.2/4.3 or 5.0.
所以還是升級hibernate到4.2/4.3 or 5.0,hibernate最新的穩定的版本到了5.1.0.Final。
本博客后續會推出Spring4.2.6+Hibernate5.1.0+Shiro1.2.4的相關升級、集成博文。敬請期待。
?本文轉自 w156445045 51CTO博客,原文鏈接:
http://blog.51cto.com/enetq/1783339,如需轉載請自行聯系原作者
總結
以上是生活随笔為你收集整理的Spring4.x新特性的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 006——php字符串中的处理函数(五)
- 下一篇: FileReader类型之文字读取