What’s New in the Spring Framework 5.X?

Hello friends!!! It is great feeling to heard about Spring Community has been released the first Spring Framework 5.0 milestone (Spring Framework 5.0 M1) at 28 July 2016. This initial milestone covers all of our baseline upgrade efforts, in particular going JDK 8+ all across the codebase, plus support for JUnit 5. And it delivers fundamental JDK 9 compatibility at runtime as well as for the framework build and test suite.
JDK 8+9 and Java EE 7 Baseline
  • Entire framework codebase based on Java 8 source code level now.
    • Improved readability through inferred generics etc.
    • Conditional support for Java 8 features now in straight code.
  • Java EE 7 API level required in Spring’s corresponding modules now.
    • Servlet 3.1, JMS 2.0, JPA 2.1, Bean Validation 1.1
    • Recent servers: e.g. Tomcat 8.5+, Jetty 9.3+, WildFly 10+
  • Full compatibility with JDK 9 as of July 2016.
    • Project spring-framework can be built on JDK 9; test suite passes.
Removed Packages, Classes and Methods
  • Package mock.staticmock removed from spring-aspects module.
    • No support for AnnotationDrivenStaticEntityMockingControl anymore.
  • Packages web.view.tiles2 and orm.hibernate3/hibernate4 dropped.
    • Minimum requirement: Tiles 3 and Hibernate 5 now.
  • Dropped support: Portlet, Velocity, JasperReports, XMLBeans, JDO, Guava.
    • Recommendation: Stay on Spring Framework 4.3.x for those if needed.
  • Many deprecated classes and methods removed across the codebase.
    • A few compromises made for commonly used methods in the ecosystem.
Core Container Improvements
  • JDK 8+ enhancements
    • Efficient method parameter access based on Java 8 reflection enhancements.
    • Selective declarations of Java 8 default methods in core Spring interfaces.
    • Consistent use of JDK 7 Charset and StandardCharsets enhancements.
  • JDK 9 preparations
    • Consistent instantiation via constructors (with revised exception handling)
  • XML configuration namespaces streamlined towards unversioned schemas.
    • Always resolved against latest xsd files; no support for deprecated features.
    • Version-specific declarations still supported but validated against latest schema.
  • Resource abstraction provides isFile indicator for defensive getFile access.
General Web Improvements
  • Unified support for media type resolution through MediaTypeFactory delegate.
  • Full Servlet 3.1 signature support in Spring-provided Filter implementations.
  • Support for Protobuf 3.0 (currently beta 4).
Reactive Programming Model
  • spring-core DataBuffer and Encoder/Decoder abstractions with non-blocking semantics.
  • spring-web HTTP message codec implementations with JSON (Jackson) and XML (JAXB) support.
  • New spring-web-reactive module with reactive support for the @Controller programming model adapting Reactive Streams to Servlet 3.1 containers as well as non-Servlet runtimes such as Netty and Undertow.
  • New WebClient with reactive support on the client side.
Testing Improvements

  • Complete support for JUnit 5’s Jupiter programming and extension models in the Spring TestContext Framework.
    • SpringExtension: an implementation of multiple extension APIs from JUnit Jupiter that provides full support for the existing feature set of the Spring TestContext Framework. This support is enabled via @ExtendWith(SpringExtension.class).
    • @SpringJUnitConfig: a composed annotation that combines @ExtendWith(SpringExtension.class)  from JUnit Jupiter with @ContextConfigurationfrom the Spring TestContext Framework.
    • @SpringJUnitWebConfig: a composed annotation that combines @ExtendWith(SpringExtension.class)  from JUnit Jupiter with @ContextConfiguration and @WebAppConfiguration from the Spring TestContext Framework.
  • New before and after test execution callbacks in the Spring TestContext Framework with support for TestNG, JUnit 5, and JUnit 4 via the SpringRunner (but not via JUnit 4 rules).
    • New beforeTestExecution() and afterTestExecution() callbacks in the TestExecutionListener API and TestContextManager.
  • XMLUnit support upgraded to 2.2

Data taken from:
https://spring.io/blog/2016/07/28/spring-framework-5-0-m1-released

Previous
Next
Dinesh Rajput

Dinesh Rajput is the chief editor of a website Dineshonjava, a technical blog dedicated to the Spring and Java technologies. It has a series of articles related to Java technologies. Dinesh has been a Spring enthusiast since 2008 and is a Pivotal Certified Spring Professional, an author of a book Spring 5 Design Pattern, and a blogger. He has more than 10 years of experience with different aspects of Spring and Java design and development. His core expertise lies in the latest version of Spring Framework, Spring Boot, Spring Security, creating REST APIs, Microservice Architecture, Reactive Pattern, Spring AOP, Design Patterns, Struts, Hibernate, Web Services, Spring Batch, Cassandra, MongoDB, and Web Application Design and Architecture. He is currently working as a technology manager at a leading product and web development company. He worked as a developer and tech lead at the Bennett, Coleman & Co. Ltd and was the first developer in his previous company, Paytm. Dinesh is passionate about the latest Java technologies and loves to write technical blogs related to it. He is a very active member of the Java and Spring community on different forums. When it comes to the Spring Framework and Java, Dinesh tops the list!

Share
Published by
Dinesh Rajput

Recent Posts

Strategy Design Patterns using Lambda

Strategy Design Patterns We can easily create a strategy design pattern using lambda. To implement…

2 years ago

Decorator Pattern using Lambda

Decorator Pattern A decorator pattern allows a user to add new functionality to an existing…

2 years ago

Delegating pattern using lambda

Delegating pattern In software engineering, the delegation pattern is an object-oriented design pattern that allows…

2 years ago

Spring Vs Django- Know The Difference Between The Two

Technology has emerged a lot in the last decade, and now we have artificial intelligence;…

2 years ago

TOP 20 MongoDB INTERVIEW QUESTIONS 2022

Managing a database is becoming increasingly complex now due to the vast amount of data…

2 years ago

Scheduler @Scheduled Annotation Spring Boot

Overview In this article, we will explore Spring Scheduler how we could use it by…

3 years ago