How Spring 5 different from other versions

Posted By : Navin Purohit | 30-Jul-2018

How Spring 5 different from other versions?

Spring 5 is a major release from the spring framework in July 2017. In this blog, we discussed the features of Spring Framework 5.0 at a high level:

1. JDK Baseline Update

Spring 5.0 works on Java 8 which is a minimum requirement for spring 5.0. We can enjoy all the Java 8 features along with framework features. Spring 5.0 also support Java 9.

2. Core Framework Revision

The core Spring Framework 5.0 changes to use the new features of Java 8. Important Revisions in core framework are:- 
>Due to Java 8 reflection improvements, Spring parameter methods can be efficiently accessed.
>Core spring now give a specific declaration to Java 8 default methods. 
>Spring now deal with NullPointerException at runtime by using 2 annotations i.e. @NotNull and @Nullable.

3. Core Container Updates

Spring core container now assists the candidate component index to shortcut the candidate component identification step in the classpath scanner. Candidate component scanner helpful in large projects where you can increase the daily productivity while the difference is not visible in small projects.


4.Functional Programming With Kotlin

Spring 5.0 support for JetBrains Kotlin language. Kotlin support functional programming style which is an object-oriented language. We can use kotlin for bean registration alternative to XML or @Configuration and @Bean.

5.Reactive Programming Model

One of my favorite feature in this spring version is reactive stack Web Framework. If you are using Java 8 then you have to include a dependency for the Reactive Streams API specification. But for Java 9 no need to include any dependency. Spring 5.0 support to reactive HTTP and WebSocket clients.

6. Testing Improvements

Spring 5.0 fully support to Junit5 Jupiter to write test cases. Spring provides support to parallel test execution. For reactive programming model, spring now includes WebTestClient for integrating testing support for Spring WebFlux.

7. Library Support

Spring 5.0 supports the following upgraded library versions:-
>Jackson 2.6+
>Hibernate 5.0+
>JDBC 4.0+
>XmlUnit 2.x+
>Netty 4.1+ 

 

About Author

Author Image
Navin Purohit

Navin has an experience of 4 years in Java and NodeJS. He is eager to learn new technologies and want to explore his inner strengths.

Request for Proposal

Name is required

Comment is required

Sending message..