上QQ阅读APP看书,第一时间看更新
Usage of JDK 8 features in Spring Framework code
The Spring Framework 4.x baseline version is Java SE 6. This means that it supports Java 6, 7, and 8. Having to support Java SE 6 and 7 puts constraints on the Spring Framework code. The framework code cannot use any of the new features in Java 8. So, while the rest of the world upgraded to Java 8, the code in Spring Framework (at least the major parts) was restricted to using earlier versions of Java.
With Spring Framework 5.0, the baseline version is Java 8. Spring Framework code is now upgraded to use the new features in Java 8. This will result in more readable and performant framework code. Some of the Java 8 features used are as follows:
- Java 8 default methods in core Spring interfaces
- Internal code improvements based on Java 8 reflection enhancements
- Use of functional programming in the framework code--lambdas and streams