Agility, Java programming, New technologies and more…
  • rss
  • Home
  • Management
  • Agile Programming
  • Technology
  • Linux
  • Event
  • Android app
  • Contact
  • About the author
  • English
  • Francais

QCon London 2016 – Spring Framework 5 – Preview & Roadmap

Fabian Piau | Tuesday March 15th, 2016 - 11:49 PM
  • Print
  • Twitter
  • LinkedIn
  • Facebook
  • Pocket

 Version française disponible

Juergen Hoeller, the co-founder of the Spring framework was doing a presentation last week at QCon London.

QCon London 2016 - Spring Framework 5 - Preview & Roadmap

QCon London 2016 - Spring Framework 5 - Preview & Roadmap


Some history background first, the Spring framework has been created in 2002 with a first release in 2004 (yes, it was 12 years ago!), quite a long time for a framework which is still widely used and under development. The adoption and the number of projects within Spring has never stopped growing since. At the beginning, Spring was created to manage POJOs in a lightweight container by using dependency injection (following the Inversion of Control or IoC principle), Spring was an alternative to heavy JEE containers such as GlassFish or WebSphere.


Spring has now become a set of projects that are available to fulfill many requirements when building an application. Spring is like a set of Lego bricks, you can pick and assemble these compatible sub-projects to build something bigger.

  • Imagine you want to use a database, you can use Spring Data
  • You need to secure your application, just use Spring Security
  • You want to be able to login to your application through social networks, Spring Social is here for you
  • And so on

You can take a look at the full list of Spring projects.


Spring 4.3

Before jumping to Spring 5, Juergen talked about Spring 4. When I write this post, the current version is 4.2.5. A release candidate (RC) of Spring 4.3 will be available in March 2016 followed by a General availability (GA) one in May 2016. This version will include a couple of handy changes:

  • In Spring Framework core:
    The @autowired annotation used to inject a dependency will be implicit so will become optional
  • In Spring MVC (part of the core):
    The declaration of a MVC controller is refined. Before, value was the attribute name:

    @RequestMapping(value = '/mypath', method = RequestMethod.POST)
    

    After, we use a more meaningful name path:

    @RequestMapping(path = '/mypath', method = RequestMethod.POST)
    

    There are even new annotation shortcuts to avoid specifying the HTTP method attribute. And even the attribute name is optional, so it becomes very simple.

    @PostMapping('/mypath')
    

    And the equivalent for a GET

    @GetMapping('/mypath')
    


Spring 5.0 announced

Then, Juergen announced that Spring 5.0 will be available sometime in 2017 and compatible with JDK 8 and 9. On the roadmap, the GA should be available in March 2017 (at the same time the JDK 9 will be released). In case JDK 9 release is delayed, Spring 5.0 will be probably delayed too.


What are the major updates in Spring 5?

There are 3 key infrastructure themes:

  • JDK 9 and Jigsaw modules
  • Servlet 4.0 and HTTP/2
  • Reactive architecture


JDK 9 and use of Jigsaw

In short, Jigsaw brings modularity to the JDK. The JDK is split up into modules and you can pick up only the ones you need to make your application works.

The JDK will come with a set of modules, but you can also define your owns. To define a module, you need to create a module-info.java file:

module my.app.db {
  requires java.sql;
  requires spring.jdbc;
}

Inside a module, you specify the modules you need with the keyword requires. Modules are managing transitive dependencies, a bit like Maven. If I use the module my.app.db above, I will be able to access any classes coming from the java.sql module. The main benefit is that it makes your application more modular relying on a subset of modules instead of a full JDK.

All the jars for Spring 5 will come with Jigsaw metadata out of the box, the module name will follow the Maven Central jar naming to avoid confusion (spring-context, spring-jdbc, spring-webmvc…). It will be very easy to build your applications by specifying the Spring modules you need.


HTTP/2

HTTP/1.1 is an old protocol (1999) and has some limitations. In the front-end world, we are using some workarounds, but it is not ideal. For example, to avoid overloading the server with multiple requests when a page contains a lot of images, we use CSS sprites (i.e. combine these images into one single file that we then split on the client side via CSS). With HTTP/2, the protocol is faster as it allows concurrency requests and removes the “head-of-line blocking”. There are other benefits that you can read on the HTTP/2 Frequently Asked Questions page.

As Juergen stated, “We need to embrace HTTP/2 in the Java land as well!”

To achieve that, Spring 5 will use the latest version of the Servlet library, Servlet 4.0 that:

  • Enforces support for HTTP/2 in servlet containers
  • Gives API features for Stream priorization and push resources


Reactive programming

Another big announcement was the creation of a new Spring project called Spring Reactive. It will be a Spring MVC-like endpoint based on a reactive foundation.

  • Reuses Spring MVC programming model style
  • But accepting and returning reactive streams (e.g. Mono – 1 element, Flux – list of elements)

Spring Reactive will be based on Project Reactor, a set of foundational libraries for building reactive cloud-ready applications on the JVM. This new project is not stand-alone and will be included in the Spring Framework core at some point.

Juergen reminds us that “Reactive is coming”:

  • No blocking thread involved
  • Reactive datastore drivers become available (PostgreSQL, Mongo, Couchbase…)
  • Reactive HTTP client (Netty, Jetty, OkHttp…)

Note for myself and maybe for you as well, it is important to read some materials on Reactive and get familiar with the concepts, it will probably spread in the following years.


Last but not least, Spring 5 will use all the latest features introduced with Java 8:

  • Lambdas, method reference, default methods in interfaces
  • Ability to expose JDK 8 API types in core interfaces and classes: java.util.Optional, java.util.function, java.util.stream


As a matter of fact, Spring 5 will require Java 8. If your project is still using an older version, you will have to use Spring 4.X. The good news is that Spring 4 will have an extended support until 2020, so you will still have some time to migrate!


Slides of the presentation are available on the QCon website.

Related posts

java-9QCon London 2016 – Project Jigsaw in JDK 9 – Modularity comes to Java Java 11A Java 11 migration successful story Java EE vs SpringJava EE & CDI vs. Spring devoxxDevoxx UK 2018 – Day 1
Categories
Event
Tags
qcon, spring
Comments rss
Comments rss

« The best free and online tools for testing and optimizing an application or website QCon London 2016 – Project Jigsaw in JDK 9 – Modularity comes to Java »

Download CarmaBlog App

RSS feeds

  • RSS feed RSS - Posts
  • RSS feed RSS - Comments

Most viewed posts

  • Changing the language in Firefox - 116,375 views
  • Using Google Forms / Drive / Docs to create an online survey - 64,403 views
  • FAQ – Online survey with Google Forms / Drive / Docs - 56,248 views
  • Customizing Gnome 3 (Shell) - 30,809 views
  • The meaning of URL, URI, URN - 18,408 views
  • Java EE & CDI vs. Spring - 15,986 views
  • Open Street Map, better map than Google Maps? - 15,801 views
  • Comparing NoSQL: Couchbase & MongoDB - 14,693 views
  • API, REST, JSON, XML, HTTP, URI… What language do you speak? - 13,731 views
  • First steps with Apache Camel - 13,597 views

Recent Comments

  • Fabian Piau on FAQ – Online survey with Google Forms / Drive / DocsOui, dans Google Forms, vous pouvez empêcher les p…
  • BENECH Fabien on FAQ – Online survey with Google Forms / Drive / DocsBonjour, J'ai crée 1 questionnaire via Forms,…
  • SANKARA TIDIANE on Free online MongoDB trainingJ'aimerai suivre
  • Pauline on FAQ – Online survey with Google Forms / Drive / DocsMerci Fabian, mais le but étant que nos clients pu…
  • Fabian Piau on FAQ – Online survey with Google Forms / Drive / DocsProbablement mais ces options sont en général paya…

Recent posts

  • How to write a blog post? At least my way! - 2 years and 5 months ago
  • Bot Attacks: You are not alone… - 4 years and 1 month ago
  • Flagger – Monitor your Canary deployments with Grafana - 4 years and 10 months ago
  • Flagger – Canary deployments on Kubernetes - 5 years and 2 days ago
  • Flagger – Get Started with Istio and Kubernetes - 5 years and 2 weeks ago
  • Expedia CoderDojo in London - 5 years and 10 months ago
  • Volunteering at Devoxx4Kids - 6 years and 2 weeks ago
  • A Java 11 migration successful story - 6 years and 4 months ago
  • Tips to make your WordPress website secure - 6 years and 7 months ago
  • Devoxx UK 2018 – Day 2 - 6 years and 11 months ago
  • Devoxx UK 2018 – Day 1 - 7 years and 12 hours ago
  • Wise, Revolut and Monzo, a small revolution for travelers and expats - 7 years and 3 months ago
  • Autocomplete for Git - 8 years and 1 day ago
  • Swagger, the automated API documentation - 8 years and 2 months ago
  • Microservices architecture – Best practices - 8 years and 7 months ago
Buy me a coffee

Language

  • Français
  • English

Follow me!

Follow me on Linkedin
Follow me on Twitter
Follow me on Stackoverflow
Follow me on Github
Follow me on Rss
Link to my Contact

Email subscription

Enter your email address to receive notifications of new posts.

Tags

.net agile agility android bash best practices blog cache cloud computing conference continuous integration css developer devoxx docker eclipse extreme programming firefox flagger google helm hibernate istio java job jug kubernetes london mobile computing overview performance plugin programmer script security sharing society spring tdd test tool ubuntu windows wordpress

Links

  • Blog Ippon Technologies
  • Blog Publicis Sapient
  • Blog Zenika
  • Classpert
  • CommitStrip
  • Coursera
  • Le Touilleur Express
  • Les Cast Codeurs Podcast
  • OCTO talks !
  • The Twelve-Factor App

Categories

  • Event (15)
  • Linux (3)
  • Management (8)
  • Agile programming (29)
  • Technology (45)

Archives

  • December 2022 (1)
  • April 2021 (1)
  • June 2020 (1)
  • May 2020 (2)
  • July 2019 (1)
  • May 2019 (1)
  • December 2018 (1)
  • October 2018 (1)
  • June 2018 (1)
  • May 2018 (1)
  • January 2018 (1)
  • May 2017 (1)
  • March 2017 (1)
  • October 2016 (1)
  • April 2016 (2)
  • March 2016 (1)
  • November 2015 (1)
  • May 2015 (1)
  • February 2015 (1)
  • December 2014 (1)
  • November 2014 (1)
  • September 2014 (2)
  • August 2014 (1)
  • July 2014 (2)
  • June 2014 (1)
  • April 2014 (1)
  • March 2014 (1)
  • February 2014 (2)
  • January 2014 (1)
  • December 2013 (1)
  • November 2013 (1)
  • October 2013 (3)
  • September 2013 (5)
  • July 2013 (1)
  • June 2013 (1)
  • May 2013 (1)
  • April 2013 (1)
  • March 2013 (2)
  • February 2013 (1)
  • January 2013 (2)
  • December 2012 (2)
  • October 2012 (1)
  • September 2012 (1)
  • July 2012 (1)
  • May 2012 (1)
  • April 2012 (1)
  • March 2012 (1)
  • February 2012 (1)
  • January 2012 (2)
  • December 2011 (1)
  • November 2011 (2)
  • October 2011 (2)
  • September 2011 (1)
  • July 2011 (1)
  • June 2011 (2)
  • April 2011 (1)
  • March 2011 (1)
  • February 2011 (1)
  • January 2011 (2)
  • November 2010 (2)
  • September 2010 (1)
  • August 2010 (1)
  • July 2010 (1)
  • June 2010 (1)
  • May 2010 (1)
  • April 2010 (1)
  • March 2010 (1)
  • February 2010 (1)
  • December 2009 (1)
  • November 2009 (1)
  • October 2009 (2)
  • September 2009 (2)
  • August 2009 (3)
  • July 2009 (1)
  • June 2009 (2)
Follow me on Twitter
Follow me on Linkedin
Follow me on Stackoverflow
Follow me on Rss
Link to my Contact
Follow me on Github
 
Fabian Piau | © 2009 - 2025
All Rights Reserved | Top ↑