SlideShare a Scribd company logo
1 of 25
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/1
Spring Framework 5.0
Preview & Roadmap
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Juergen Hoeller
Spring Framework Lead
Pivotal
InfoQ.com: News & Community Site
• 750,000 unique visitors/month
• Published in 4 languages (English, Chinese, Japanese and Brazilian
Portuguese)
• Post content from our QCon conferences
• News 15-20 / week
• Articles 3-4 / week
• Presentations (videos) 12-15 / week
• Interviews 2-3 / week
• Books 1 / month
Watch the video with slide
synchronization on InfoQ.com!
http://www.infoq.com/presentations
/spring-framework-5
Purpose of QCon
- to empower software development by facilitating the spread of
knowledge and innovation
Strategy
- practitioner-driven conference designed for YOU: influencers of
change and innovation in your teams
- speakers and topics driving the evolution and innovation
- connecting and catalyzing the influencers and innovators
Highlights
- attended by more than 12,000 delegates since 2007
- held in 9 cities worldwide
Presented at QCon London
www.qconlondon.com
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/2
On our way to 5.0
First up: 4.3
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/3
Spring Framework 4.3
■ Last 4.x feature release!
■ 4.3 RC1: March 2016
■ 4.3 GA: May 2016
■ Extended support life until 2020
● on JDK 6, 7, 8 and 9
● on Tomcat 6, 7, 8 and 9
● on WebSphere 7, 8.0, 8.5 and 9
■ Programming model refinements brought forward to JDK 6+
● DI & MVC refinements, composed annotations
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/4
The State of the Art: Component Classes
@Service
@Lazy
public class MyBookAdminService implements BookAdminService {
// @Autowired
public MyBookAdminService(AccountRepository repo) {
...
}
@Transactional
public BookUpdate updateBook(Addendum addendum) {
...
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/5
Configuration Classes with Autowired Constructors
@Configuration
public class MyBookAdminConfig {
private final DataSource bookAdminDataSource;
// @Autowired
public MyBookAdminService(DataSource bookAdminDataSource) {
this.bookAdminDataSource = bookAdminDataSource;
}
@Bean
public BookAdminService myBookAdminService() {
MyBookAdminService service = new MyBookAdminService();
service.setDataSource(this.bookAdminDataSource);
return service;
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/6
Refined MVC Controller Declarations
@Controller
@CrossOrigin
public class MyRestController {
@RequestMapping(path="/books/{id}", method=GET)
public Book findBook(@PathVariable long id) {
return this.bookAdminService.findBook(id);
}
@RequestMapping(path="/books/new", method=POST)
public void newBook(@Valid Book book) {
this.bookAdminService.storeBook(book);
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/7
Precomposed Annotations for MVC Controllers
@RestController
@CrossOrigin
public class MyRestController {
@GetMapping("/books/{id}")
public Book findBook(@PathVariable long id) {
return this.bookAdminService.findBook(id);
}
@PostMapping("/books/new")
public void newBook(@Valid Book book) {
this.bookAdminService.storeBook(book);
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/8
Themes for 5.0:
JDK 9, HTTP/2, Reactive
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/9
Spring Framework 5.0
■ A new framework generation for 2017+
■ 5.0 M1: mid 2016
■ 5.0 RC1: December 2016
■ Major baseline upgrade
● JDK 8+, Servlet 3.0+, JMS 2.0+, JPA 2.1+, JUnit 5
■ Key infrastructure themes
● JDK 9 and Jigsaw modules
● Servlet 4.0 and HTTP/2
● Reactive architectures
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/10
JDK 8+ Baseline
■ Spring 4.x: comprehensive support for Java 8 features in an application's
component classes
● Spring annotations declared as repeatable already
● typical Spring callback interfaces designed in a lambda-friendly style
● reflectively adapting to user-provided signatures
■ Spring 5.x: use of Java 8 features in the framework's own core codebase
● lambdas, method references, default methods in interfaces
● able to expose JDK 8 API types in core interfaces and classes:
java.util.Optional, java.util.function, java.util.stream
■ An important enabler for further evolution of the framework...
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/11
Comprehensive JDK 9 Support
■ Spring 5 schedule is close to JDK 9 schedule
● JDK 9 intends to go GA in March 2017
■ Jigsaw – a new module system for applications
● symbolic module names and requires/exports metadata for jar files
● currently no versioning, just structuring plus visibility enforcement
● module path as alternative to class path
■ New HTTP client and general support for HTTP/2
● superseding the outdated java.net.HttpURLConnection
● TLS extension for ALPN
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/12
Using Jigsaw with Spring
■ Spring Framework jars coming with Jigsaw metadata out of the box
● internally declaring module-info for each jar
■ Separate module namespace, following Maven Central jar naming
● spring-context, spring-jdbc, spring-webmvc
■ An application's module-info.java can then look as follows...
module my.app.db {
requires java.sql;
requires spring.jdbc;
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/13
The Importance of HTTP/2 (RFC 7540)
■ Enormous benefits over HTTP 1.1 (which dates back to 1996)
● binary protocol
● TLS (SSL) everywhere
● connection multiplexing
● headers compression
● request prioritization
● push of correlated resources
■ Browsers already implement HTTP/2 over TLS
● major websites work with HTTP/2 already: Google, Twitter, etc
● We need to embrace it in Java land as well!
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/14
Spring 5 and HTTP/2
■ Servlet 4.0 – mid 2017
● enforces support for HTTP/2 in Servlet containers
● API features for stream prioritization and push resources
■ Tomcat / Jetty / Undertow
● native HTTP/2 support available in current Servlet 3.1 containers
● Tomcat 8.1 / 9.0, Jetty 9.3, Undertow 1.3
■ Spring Framework 5.0 will ship dedicated Servlet 4.0 support
● as well as dedicated support for the new JDK 9 HTTP client
● but like 4.3, it focuses on native HTTP/2 on top of Tomcat / Jetty / Undertow
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/15
The Importance of Reactive Architectures
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/16
Reactive Streams Specification
■ Focus on infrastructure interoperability
● web servers, datastore drivers
● and of course: web frameworks!
■ Minimal API
● Publisher + Subscriber/Subscription for backpressure support
● repackaged into JDK 9 as java.util.concurrent.Flow
■ Operators left up to composition libraries
● map, flatMap, take, subscribe, ...
● Reactor, RxJava, Akka Streams
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/17
Reactive Web Endpoints in Spring
■ A Spring MVC like endpoint model based on a reactive foundation
● reusing the common Spring MVC programming model style
● but accepting and returning reactive streams
■ A new HTTP endpoint engine on top of a non-blocking runtime
● Netty, Jetty, Tomcat, Undertow
● not based on the Servlet API but adaptable to a Servlet container
■ Currently developed as a public R&D project
● https://github.com/spring-projects/spring-reactive/
● to be merged into Spring Framework master for 5.0 M1 in June
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/18
Reactive Web Controller with RxJava Observable
@Controller
public class MyReactiveWebController {
@RequestMapping("/capitalize")
public Observable<Person> capitalize(Observable<Person> persons) {
return persons.map(person -> {
person.setName(person.getName().toUpperCase());
return person;
}
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/19
Reactive Web Controller with Reactor Flux
@Controller
public class MyReactiveWebController {
@RequestMapping("/capitalize")
public Flux<Person> capitalize(Flux<Person> persons) {
return persons.map(person -> {
person.setName(person.getName().toUpperCase());
return person;
}
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/20
Reactive Web Controller with Repository Interop
@Controller
public class MyReactiveWebController {
@Autowired
private MyRepository<Person> repository;
@RequestMapping("/insert")
public Mono<Void> insert(Flux<Person> persons) {
return this.repository.insert(persons);
}
}
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/21
Reactive Infrastructure All Around
■ Reactive datastore drivers becoming available
● Postgres, Mongo, Couchbase
■ Reactive HTTP clients
● Netty, Jetty, OkHttp
■ Reactive Streams Commons project
● Servlet adapters: by default against Servlet 3.1 async I/O
● native container SPI for more efficiency at runtime
● currently a collaboration between Spring and Jetty / Tomcat
Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a
Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/22
Summary
Spring Framework 4.3 (May 2016)
Programming model refinements on JDK 6/7/8
Spring Framework 5.0 (early 2017)
JDK 8+9, Jigsaw, HTTP/2, Reactive Streams
Watch the video with slide synchronization on
InfoQ.com!
http://www.infoq.com/presentations/spring-
framework-5

More Related Content

Viewers also liked

An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...Steve Pember
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaPeter Lawrey
 
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)Sang Don Kim
 
Why zsh is Cooler than Your Shell
Why zsh is Cooler than Your ShellWhy zsh is Cooler than Your Shell
Why zsh is Cooler than Your Shellbrendon_jag
 
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)Sang Don Kim
 
Supercharged java 8 : with cyclops-react
Supercharged java 8 : with cyclops-reactSupercharged java 8 : with cyclops-react
Supercharged java 8 : with cyclops-reactJohn McClean
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examplesPeter Lawrey
 
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016Sang Don Kim
 

Viewers also liked (11)

An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...An introduction to Reactive applications, Reactive Streams, and options for t...
An introduction to Reactive applications, Reactive Streams, and options for t...
 
Writing and testing high frequency trading engines in java
Writing and testing high frequency trading engines in javaWriting and testing high frequency trading engines in java
Writing and testing high frequency trading engines in java
 
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)
[Td 2015]너에게만 나는 반응해 반응형 응용프로그램(이규원)
 
Why zsh is Cooler than Your Shell
Why zsh is Cooler than Your ShellWhy zsh is Cooler than Your Shell
Why zsh is Cooler than Your Shell
 
Reactive Web Applications
Reactive Web ApplicationsReactive Web Applications
Reactive Web Applications
 
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)
[TD 2015] windows server에서 만나보는 docker와 windows container(최한홍)
 
Supercharged java 8 : with cyclops-react
Supercharged java 8 : with cyclops-reactSupercharged java 8 : with cyclops-react
Supercharged java 8 : with cyclops-react
 
Reactive programming with examples
Reactive programming with examplesReactive programming with examples
Reactive programming with examples
 
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016
[Td 2015] 국내에서 처음으로 선보이는 microsoft 차세대 서버 운영 체제 windows server 2016
 
Java 9 Modularity in Action
Java 9 Modularity in ActionJava 9 Modularity in Action
Java 9 Modularity in Action
 
Java modularity: life after Java 9
Java modularity: life after Java 9Java modularity: life after Java 9
Java modularity: life after Java 9
 

More from C4Media

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoC4Media
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileC4Media
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020C4Media
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsC4Media
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No KeeperC4Media
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like OwnersC4Media
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaC4Media
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideC4Media
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDC4Media
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine LearningC4Media
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at SpeedC4Media
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsC4Media
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsC4Media
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerC4Media
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleC4Media
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeC4Media
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereC4Media
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing ForC4Media
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data EngineeringC4Media
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreC4Media
 

More from C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Recently uploaded

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Recently uploaded (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Spring Framework 5 - Preview & Roadmap

  • 1. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/1 Spring Framework 5.0 Preview & Roadmap Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Juergen Hoeller Spring Framework Lead Pivotal
  • 2. InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /spring-framework-5
  • 3. Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide Presented at QCon London www.qconlondon.com
  • 4. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/2 On our way to 5.0 First up: 4.3
  • 5. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/3 Spring Framework 4.3 ■ Last 4.x feature release! ■ 4.3 RC1: March 2016 ■ 4.3 GA: May 2016 ■ Extended support life until 2020 ● on JDK 6, 7, 8 and 9 ● on Tomcat 6, 7, 8 and 9 ● on WebSphere 7, 8.0, 8.5 and 9 ■ Programming model refinements brought forward to JDK 6+ ● DI & MVC refinements, composed annotations
  • 6. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/4 The State of the Art: Component Classes @Service @Lazy public class MyBookAdminService implements BookAdminService { // @Autowired public MyBookAdminService(AccountRepository repo) { ... } @Transactional public BookUpdate updateBook(Addendum addendum) { ... } }
  • 7. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/5 Configuration Classes with Autowired Constructors @Configuration public class MyBookAdminConfig { private final DataSource bookAdminDataSource; // @Autowired public MyBookAdminService(DataSource bookAdminDataSource) { this.bookAdminDataSource = bookAdminDataSource; } @Bean public BookAdminService myBookAdminService() { MyBookAdminService service = new MyBookAdminService(); service.setDataSource(this.bookAdminDataSource); return service; } }
  • 8. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/6 Refined MVC Controller Declarations @Controller @CrossOrigin public class MyRestController { @RequestMapping(path="/books/{id}", method=GET) public Book findBook(@PathVariable long id) { return this.bookAdminService.findBook(id); } @RequestMapping(path="/books/new", method=POST) public void newBook(@Valid Book book) { this.bookAdminService.storeBook(book); } }
  • 9. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/7 Precomposed Annotations for MVC Controllers @RestController @CrossOrigin public class MyRestController { @GetMapping("/books/{id}") public Book findBook(@PathVariable long id) { return this.bookAdminService.findBook(id); } @PostMapping("/books/new") public void newBook(@Valid Book book) { this.bookAdminService.storeBook(book); } }
  • 10. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/8 Themes for 5.0: JDK 9, HTTP/2, Reactive
  • 11. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/9 Spring Framework 5.0 ■ A new framework generation for 2017+ ■ 5.0 M1: mid 2016 ■ 5.0 RC1: December 2016 ■ Major baseline upgrade ● JDK 8+, Servlet 3.0+, JMS 2.0+, JPA 2.1+, JUnit 5 ■ Key infrastructure themes ● JDK 9 and Jigsaw modules ● Servlet 4.0 and HTTP/2 ● Reactive architectures
  • 12. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/10 JDK 8+ Baseline ■ Spring 4.x: comprehensive support for Java 8 features in an application's component classes ● Spring annotations declared as repeatable already ● typical Spring callback interfaces designed in a lambda-friendly style ● reflectively adapting to user-provided signatures ■ Spring 5.x: use of Java 8 features in the framework's own core codebase ● lambdas, method references, default methods in interfaces ● able to expose JDK 8 API types in core interfaces and classes: java.util.Optional, java.util.function, java.util.stream ■ An important enabler for further evolution of the framework...
  • 13. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/11 Comprehensive JDK 9 Support ■ Spring 5 schedule is close to JDK 9 schedule ● JDK 9 intends to go GA in March 2017 ■ Jigsaw – a new module system for applications ● symbolic module names and requires/exports metadata for jar files ● currently no versioning, just structuring plus visibility enforcement ● module path as alternative to class path ■ New HTTP client and general support for HTTP/2 ● superseding the outdated java.net.HttpURLConnection ● TLS extension for ALPN
  • 14. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/12 Using Jigsaw with Spring ■ Spring Framework jars coming with Jigsaw metadata out of the box ● internally declaring module-info for each jar ■ Separate module namespace, following Maven Central jar naming ● spring-context, spring-jdbc, spring-webmvc ■ An application's module-info.java can then look as follows... module my.app.db { requires java.sql; requires spring.jdbc; }
  • 15. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/13 The Importance of HTTP/2 (RFC 7540) ■ Enormous benefits over HTTP 1.1 (which dates back to 1996) ● binary protocol ● TLS (SSL) everywhere ● connection multiplexing ● headers compression ● request prioritization ● push of correlated resources ■ Browsers already implement HTTP/2 over TLS ● major websites work with HTTP/2 already: Google, Twitter, etc ● We need to embrace it in Java land as well!
  • 16. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/14 Spring 5 and HTTP/2 ■ Servlet 4.0 – mid 2017 ● enforces support for HTTP/2 in Servlet containers ● API features for stream prioritization and push resources ■ Tomcat / Jetty / Undertow ● native HTTP/2 support available in current Servlet 3.1 containers ● Tomcat 8.1 / 9.0, Jetty 9.3, Undertow 1.3 ■ Spring Framework 5.0 will ship dedicated Servlet 4.0 support ● as well as dedicated support for the new JDK 9 HTTP client ● but like 4.3, it focuses on native HTTP/2 on top of Tomcat / Jetty / Undertow
  • 17. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/15 The Importance of Reactive Architectures
  • 18. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/16 Reactive Streams Specification ■ Focus on infrastructure interoperability ● web servers, datastore drivers ● and of course: web frameworks! ■ Minimal API ● Publisher + Subscriber/Subscription for backpressure support ● repackaged into JDK 9 as java.util.concurrent.Flow ■ Operators left up to composition libraries ● map, flatMap, take, subscribe, ... ● Reactor, RxJava, Akka Streams
  • 19. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/17 Reactive Web Endpoints in Spring ■ A Spring MVC like endpoint model based on a reactive foundation ● reusing the common Spring MVC programming model style ● but accepting and returning reactive streams ■ A new HTTP endpoint engine on top of a non-blocking runtime ● Netty, Jetty, Tomcat, Undertow ● not based on the Servlet API but adaptable to a Servlet container ■ Currently developed as a public R&D project ● https://github.com/spring-projects/spring-reactive/ ● to be merged into Spring Framework master for 5.0 M1 in June
  • 20. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/18 Reactive Web Controller with RxJava Observable @Controller public class MyReactiveWebController { @RequestMapping("/capitalize") public Observable<Person> capitalize(Observable<Person> persons) { return persons.map(person -> { person.setName(person.getName().toUpperCase()); return person; } } }
  • 21. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/19 Reactive Web Controller with Reactor Flux @Controller public class MyReactiveWebController { @RequestMapping("/capitalize") public Flux<Person> capitalize(Flux<Person> persons) { return persons.map(person -> { person.setName(person.getName().toUpperCase()); return person; } } }
  • 22. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/20 Reactive Web Controller with Repository Interop @Controller public class MyReactiveWebController { @Autowired private MyRepository<Person> repository; @RequestMapping("/insert") public Mono<Void> insert(Flux<Person> persons) { return this.repository.insert(persons); } }
  • 23. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/21 Reactive Infrastructure All Around ■ Reactive datastore drivers becoming available ● Postgres, Mongo, Couchbase ■ Reactive HTTP clients ● Netty, Jetty, OkHttp ■ Reactive Streams Commons project ● Servlet adapters: by default against Servlet 3.1 async I/O ● native container SPI for more efficiency at runtime ● currently a collaboration between Spring and Jetty / Tomcat
  • 24. Unless otherwise indicated, these slides are © 2013-2016 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/22 Summary Spring Framework 4.3 (May 2016) Programming model refinements on JDK 6/7/8 Spring Framework 5.0 (early 2017) JDK 8+9, Jigsaw, HTTP/2, Reactive Streams
  • 25. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/spring- framework-5