SlideShare a Scribd company logo
1 of 25
Download to read offline
Spring Framework 5.2:
Core Container Revisited
Juergen Hoeller
October 7–10, 2019
Austin Convention Center
Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Core API Revision
Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Java 8+ Baseline in Spring Framework 5
Entire framework codebase is Java 8 based
• internal use of lambda expressions and collection streams
• efficient introspection of constructor/method parameter signatures
Framework APIs can expose Java 8 API types
• Executable, CompletableFuture, Instant, Duration, Stream
• java.util.function interfaces: Supplier, Consumer, Predicate
Framework interfaces make use of Java 8 default methods
• existing methods with default implementations for convenience
• new methods with default implementations for backwards compatibility
3

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Nullability
Comprehensive nullability declarations across the codebase
• non-null by default + individual @Nullable declarations
The Java effect: nullability validation in IntelliJ IDEA and Eclipse
• allowing applications to validate their own interaction with Spring APIs
The Kotlin effect: straightforward assignments to non-null variables
• Kotlin compiler only allows such assignments for APIs with clear nullability
Currently directly supported + JSR-305 meta-annotations
• collaboration on common code analysis annotations with Google & JetBrains
4

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Programmatic Lookup via ObjectProvider
@Autowired ObjectProvider<Foo> foo
ObjectProvider<Foo> foo = ctx.getBeanProvider(Foo.class)
ObjectProvider methods with nullability declarations
● @Nullable T getIfAvailable()
● @Nullable T getIfUnique()
Overloaded variants with java.util.function callbacks (new in 5.0)
● T getIfAvailable(Supplier<T> defaultSupplier)
● void ifAvailable(Consumer<T> dependencyConsumer)
● T getIfUnique(Supplier<T> defaultSupplier)
● void ifUnique(Consumer<T> dependencyConsumer)
5

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Bean Stream Retrieval via ObjectProvider
@Autowired ObjectProvider<Foo> foo
ObjectProvider<Foo> foo = ctx.getBeanProvider(Foo.class)
Individual object retrieval (primary/unique)
● T getObject()
● @Nullable T getIfAvailable()
● @Nullable T getIfUnique()
Iteration and stream retrieval (new in 5.1)
● Iterator<T> iterator()
● Stream<T> stream()
● Stream<T> orderedStream()
6

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Programmatic Bean Registration with Java 8
// Starting point may also be AnnotationConfigApplicationContext
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.registerBean(Foo.class);
ctx.registerBean(Bar.class,
() -> new Bar(ctx.getBean(Foo.class)));
// Or alternatively with some bean definition customizing
GenericApplicationContext ctx = new GenericApplicationContext();
ctx.registerBean(Foo.class, Foo::new);
ctx.registerBean(Bar.class,
() -> new Bar(ctx.getBeanProvider(Foo.class)),
bd -> bd.setLazyInit(true));
7

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Programmatic Bean Registration with Kotlin
// Java-style usage of Spring's Kotlin extensions
val ctx = GenericApplicationContext()
ctx.registerBean(Foo::class)
ctx.registerBean { Bar(it.getBean(Foo::class)) }
// Gradle-style usage of Spring's Kotlin extensions
val ctx = GenericApplicationContext {
registerBean<Foo>()
registerBean { Bar(it.getBean<Foo>()) }
}
8

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Performance Tuning
Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Component Scanning
Classpath scanning on startup may be slow
• <context:component-scan> or @ComponentScan
• file system traversal of all packages within the specified base packages
The common solution: narrow your base packages
• Spring only searches within the specified roots in the classpath
• alternatively: fully enumerate your component classes (no scanning at all)
New variant since 5.0: a build-time annotation processor
• spring-context-indexer generates META-INF/spring.components per jar
• automatically used at runtime for compatible component-scan declarations
1
0

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Annotation Processing
New MergedAnnotations API in 5.2
• sophisticated introspection of meta-annotation arrangements
• backing Spring's common AnnotationUtils and AnnotatedElementUtils now
Enabling a custom annotation registry
• registering presence/absence of certain annotations per component class
• bean post-processors avoid unnecessary introspection of methods/fields
Integration with indexers (e.g. Jandex) ?
• adapting index metadata to Spring's annotation lookup facilities on startup
• however, prototyping efforts did not lead to significant gains yet
11

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Component Model Implications
Most efficient: purely programmatic functional registration
• no component scanning, no reflective factory methods
• no annotation-config setup (no annotation post-processors)
@Configuration(proxyBeanMethods=false) in 5.2
• same effect: @Bean methods on non-@Configuration classes
• avoiding runtime generation of CGLIB subclasses
• drawback: no interception of cross-@Bean method calls
Prefer interface-based proxies over CGLIB proxies
• again: avoiding runtime generation of CGLIB subclasses
1
2

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Third-Party Libraries
Persistence provider bootstrapping
• consider specifying an async bootstrap executor for JPA / Hibernate
• Spring Data+Boot: spring.data.jpa.repositories.bootstrap-mode=deferred
Hibernate ORM 5.4.5
• internal performance improvements, lower memory consumption
• optional: bytecode enhancement (also for lazy loading), Jandex integration
Jackson 2.9 / 2.10
• Spring Framework 5.2 requires Jackson 2.9.7+, supports Jackson 2.10
• consider Jackson’s alternative data formats: Smile, CBOR, JSON Arrays
1
3

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
GraalVM Native Images (experimental)
Prepared for GraalVM since Spring Framework 5.1
• avoiding unnecessary internal reflection
• skipping parameter name discovery
As of Spring Framework 5.2: custom setup for GraalVM 19 GA
• explicit reflection configuration and command line args necessary
• note: Graal's SubstrateVM is still an early adopter plugin in 19 GA
Expected for Spring Framework 5.3: out-of-the-box setup
• automatic reflection setup through custom Graal configuration integration
• https://github.com/spring-projects/spring-framework/wiki/GraalVM-native-image-support
1
4

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Looking Forward: OpenJDK’s Project Loom
“Fibers”
• lightweight user-mode threads
• efficient scheduling within the JVM
Classic Thread API adapted to fibers
• e.g. ThreadLocal effectively “fiber-local”
Fibers versus reactive programming
• new life for traditional synchronous programming arrangements
• reactive programming primarily for backpressure handling ?
• Spring MVC versus Spring WebFlux
1
5

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive @ All Levels
Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Web Results (with MVC or WebFlux)
@Controller
public class MyReactiveWebController {
...
@GetMapping("/users/{id}")
public Mono<User> getUser(@PathVariable Long id) {
return this.repository.findById(id);
}
@GetMapping("/users")
public Flux<User> getUsers() {
return this.repository.findAll();
}
}
1
7

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Transactions (e.g. with R2DBC)
@Service
public class MyReactiveTransactionalService {
...
@Transactional
public Mono<User> getUser(Long id) {
return this.repository.findById(id);
}
@Transactional
public Flux<User> getUsers() {
return this.repository.findAll();
}
}
1
8

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Transaction Setup
ReactiveTransactionManager SPI
• as an alternative to PlatformTransactionManager
• relies on Reactor context instead of ThreadLocals
Implementations for R2DBC, MongoDB, Neo4j
• available in Spring Data Moore
• also usable with programmatic TransactionalOperator
Common setup through @EnableTransactionManagement
• automatic adaptation to each annotated method signature
• works with any Reactive Streams Publisher as return value
1
9

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Messaging (e.g. with RSocket)
@Controller
public class MyReactiveMessagingController {
...
@MessageMapping("echo-async")
public Mono<String> echoAsync(String payload) {
return ...
}
@MessageMapping("echo-channel")
public Flux<String> echoChannel(Flux<String> payloads) {
return ...
}
}
2
0

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive Application Events
@Service
public class MyReactiveApplicationEventService {
...
@EventListener
public Mono<MyOtherEvent> processWithResponse(MyEvent event) {
return ...
}
@EventListener
public CompletableFuture<MyOtherEvent> processAsync(MyEvent event) {
return ...
}
}
2
1

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Reactive API Adapters
Spring automatically adapts common reactive API types
• according to return/parameter declarations in user components
• org.reactivestreams.Publisher interface or library-specific API types
• adapted to Reactor Flux/Mono for internal processing purposes
Traditionally supported: RxJava 1 & 2, j.u.c.Flow, CompletableFuture
• RxJava: Flowable, Observable, Single, Maybe, Completable
• on JDK 9+: java.util.concurrent.Flow.Publisher interface
New in 5.2: support for Kotlin coroutines (“suspend fun”)
• Flow and Deferred return values, as exposed by Kotlin-based code
2
2

Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Spring Framework 5.2
Generally available now!
Java 8 API Refinements
Annotation Processing
Reactive Transactions
RSocket Messaging
Kotlin Coroutines
Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/
Spring Boot 2.2
Generally available soon!
Building on
Spring Framework 5.2
& Spring Data Moore
Stay tuned!
Stay Connected.
Related updates across the Spring portfolio...
“Hello, Spring Security 5.2” (Tue 2:00pm)
“What’s New in Spring Data?” (Tue 3:20pm)
“Running Spring Boot Applications as
GraalVM Native Images” (Tue 4:20pm)
“Spring Performance Gains” (Thu 10:30am)
#springone@s1p

More Related Content

What's hot

Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMario-Leander Reimer
 
Spring boot
Spring bootSpring boot
Spring bootsdeeg
 
Introduction to WebMvc.fn
Introduction to WebMvc.fnIntroduction to WebMvc.fn
Introduction to WebMvc.fnVMware Tanzu
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudBen Wilcock
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Summer Lu
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorialvinayiqbusiness
 
Spring framework
Spring frameworkSpring framework
Spring frameworkvietduc17
 
High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode VMware Tanzu
 
Spring framework Introduction
Spring framework IntroductionSpring framework Introduction
Spring framework IntroductionAnuj Singh Rajput
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introductionSagar Verma
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootJosué Neis
 

What's hot (20)

Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
 
Next stop: Spring 4
Next stop: Spring 4Next stop: Spring 4
Next stop: Spring 4
 
Spring boot
Spring bootSpring boot
Spring boot
 
Introduction to WebMvc.fn
Introduction to WebMvc.fnIntroduction to WebMvc.fn
Introduction to WebMvc.fn
 
Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot! Ready! Steady! SpringBoot!
Ready! Steady! SpringBoot!
 
Demo on JavaFX
Demo on JavaFXDemo on JavaFX
Demo on JavaFX
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
Serverless Spring
Serverless SpringServerless Spring
Serverless Spring
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Microservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloudMicroservices - java ee vs spring boot and spring cloud
Microservices - java ee vs spring boot and spring cloud
 
Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)Workshop Framework(J2EE/OSGi/RCP)
Workshop Framework(J2EE/OSGi/RCP)
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Spring boot
Spring bootSpring boot
Spring boot
 
High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode High Performance Cloud Native APIs Using Apache Geode
High Performance Cloud Native APIs Using Apache Geode
 
Java 9 and Beyond
Java 9 and BeyondJava 9 and Beyond
Java 9 and Beyond
 
Spring framework Introduction
Spring framework IntroductionSpring framework Introduction
Spring framework Introduction
 
Apache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolboxApache DeltaSpike the CDI toolbox
Apache DeltaSpike the CDI toolbox
 
Springboot introduction
Springboot introductionSpringboot introduction
Springboot introduction
 
PUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBootPUC SE Day 2019 - SpringBoot
PUC SE Day 2019 - SpringBoot
 

Similar to Spring Framework 5.2: Core Container Revisited

Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsVMware Tanzu
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott AndrewsVMware Tanzu
 
What's new in Spring Boot 2.0
What's new in Spring Boot 2.0What's new in Spring Boot 2.0
What's new in Spring Boot 2.0VMware Tanzu
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesVMware Tanzu
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)Tsuyoshi Miyake
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC frameworkMohit Gupta
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersGunnar Hillert
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeVMware Tanzu
 
Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers VMware Tanzu
 
Spring Integration Done Bootifully
Spring Integration Done BootifullySpring Integration Done Bootifully
Spring Integration Done BootifullyGlenn Renfro
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Zachary Klein
 
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-InSteeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-InVMware Tanzu
 
Cloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at IntuitCloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at IntuitVMware Tanzu
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...VMware Tanzu
 
Spring Boot Workshop - January w/ Women Who Code
Spring Boot Workshop - January w/ Women Who CodeSpring Boot Workshop - January w/ Women Who Code
Spring Boot Workshop - January w/ Women Who CodePurnima Kamath
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryVMware Tanzu
 
Java EE web project introduction
Java EE web project introductionJava EE web project introduction
Java EE web project introductionOndrej Mihályi
 

Similar to Spring Framework 5.2: Core Container Revisited (20)

Spring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden GemsSpring Framework 5.0: Hidden Gems
Spring Framework 5.0: Hidden Gems
 
riffing on Knative - Scott Andrews
riffing on Knative - Scott Andrewsriffing on Knative - Scott Andrews
riffing on Knative - Scott Andrews
 
What's new in Spring Boot 2.0
What's new in Spring Boot 2.0What's new in Spring Boot 2.0
What's new in Spring Boot 2.0
 
Serverless Spring 오충현
Serverless Spring 오충현Serverless Spring 오충현
Serverless Spring 오충현
 
Running Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native ImagesRunning Spring Boot Applications as GraalVM Native Images
Running Spring Boot Applications as GraalVM Native Images
 
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
クラウド時代の Spring Framework (aka Spring Framework in Cloud Era)
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Migrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring DevelopersMigrating to Angular 5 for Spring Developers
Migrating to Angular 5 for Spring Developers
 
Enabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using SteeltoeEnabling .NET Apps with Monitoring and Management Using Steeltoe
Enabling .NET Apps with Monitoring and Management Using Steeltoe
 
Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers Migrating to Angular 4 for Spring Developers
Migrating to Angular 4 for Spring Developers
 
Spring Integration Done Bootifully
Spring Integration Done BootifullySpring Integration Done Bootifully
Spring Integration Done Bootifully
 
Advanced angular
Advanced angularAdvanced angular
Advanced angular
 
Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!Grails 4: Upgrade your Game!
Grails 4: Upgrade your Game!
 
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-InSteeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
Steeltoe: Develop .NET Microservices Without Cloud Platform Lock-In
 
Cloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at IntuitCloud Configuration Ecosystem at Intuit
Cloud Configuration Ecosystem at Intuit
 
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
12 Factor, or Cloud Native Apps - What EXACTLY Does that Mean for Spring Deve...
 
Spring Boot Workshop - January w/ Women Who Code
Spring Boot Workshop - January w/ Women Who CodeSpring Boot Workshop - January w/ Women Who Code
Spring Boot Workshop - January w/ Women Who Code
 
Running Java Applications on Cloud Foundry
Running Java Applications on Cloud FoundryRunning Java Applications on Cloud Foundry
Running Java Applications on Cloud Foundry
 
Java EE web project introduction
Java EE web project introductionJava EE web project introduction
Java EE web project introduction
 
Spring boot
Spring bootSpring boot
Spring boot
 

More from VMware Tanzu

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItVMware Tanzu
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023VMware Tanzu
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleVMware Tanzu
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023VMware Tanzu
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductVMware Tanzu
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready AppsVMware Tanzu
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And BeyondVMware Tanzu
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023VMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023VMware Tanzu
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptxVMware Tanzu
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchVMware Tanzu
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishVMware Tanzu
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVMware Tanzu
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - FrenchVMware Tanzu
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023VMware Tanzu
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootVMware Tanzu
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerVMware Tanzu
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeVMware Tanzu
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsVMware Tanzu
 

More from VMware Tanzu (20)

What AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About ItWhat AI Means For Your Product Strategy And What To Do About It
What AI Means For Your Product Strategy And What To Do About It
 
Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023Make the Right Thing the Obvious Thing at Cardinal Health 2023
Make the Right Thing the Obvious Thing at Cardinal Health 2023
 
Enhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at ScaleEnhancing DevEx and Simplifying Operations at Scale
Enhancing DevEx and Simplifying Operations at Scale
 
Spring Update | July 2023
Spring Update | July 2023Spring Update | July 2023
Spring Update | July 2023
 
Platforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a ProductPlatforms, Platform Engineering, & Platform as a Product
Platforms, Platform Engineering, & Platform as a Product
 
Building Cloud Ready Apps
Building Cloud Ready AppsBuilding Cloud Ready Apps
Building Cloud Ready Apps
 
Spring Boot 3 And Beyond
Spring Boot 3 And BeyondSpring Boot 3 And Beyond
Spring Boot 3 And Beyond
 
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdfSpring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
Spring Cloud Gateway - SpringOne Tour 2023 Charles Schwab.pdf
 
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
Simplify and Scale Enterprise Apps in the Cloud | Boston 2023
 
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
Simplify and Scale Enterprise Apps in the Cloud | Seattle 2023
 
tanzu_developer_connect.pptx
tanzu_developer_connect.pptxtanzu_developer_connect.pptx
tanzu_developer_connect.pptx
 
Tanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - FrenchTanzu Virtual Developer Connect Workshop - French
Tanzu Virtual Developer Connect Workshop - French
 
Tanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - EnglishTanzu Developer Connect Workshop - English
Tanzu Developer Connect Workshop - English
 
Virtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - EnglishVirtual Developer Connect Workshop - English
Virtual Developer Connect Workshop - English
 
Tanzu Developer Connect - French
Tanzu Developer Connect - FrenchTanzu Developer Connect - French
Tanzu Developer Connect - French
 
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
Simplify and Scale Enterprise Apps in the Cloud | Dallas 2023
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software EngineerSpringOne Tour: The Influential Software Engineer
SpringOne Tour: The Influential Software Engineer
 
SpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs PracticeSpringOne Tour: Domain-Driven Design: Theory vs Practice
SpringOne Tour: Domain-Driven Design: Theory vs Practice
 
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense SolutionsSpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
SpringOne Tour: Spring Recipes: A Collection of Common-Sense Solutions
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Rob Geurden
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxRTS corp
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...Simplifying Microservices & Apps - The art of effortless development - Meetup...
Simplifying Microservices & Apps - The art of effortless development - Meetup...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptxReal-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
Real-time Tracking and Monitoring with Cargo Cloud Solutions.pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 

Spring Framework 5.2: Core Container Revisited

  • 1. Spring Framework 5.2: Core Container Revisited Juergen Hoeller October 7–10, 2019 Austin Convention Center
  • 2. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Core API Revision
  • 3. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Java 8+ Baseline in Spring Framework 5 Entire framework codebase is Java 8 based • internal use of lambda expressions and collection streams • efficient introspection of constructor/method parameter signatures Framework APIs can expose Java 8 API types • Executable, CompletableFuture, Instant, Duration, Stream • java.util.function interfaces: Supplier, Consumer, Predicate Framework interfaces make use of Java 8 default methods • existing methods with default implementations for convenience • new methods with default implementations for backwards compatibility 3 
  • 4. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Nullability Comprehensive nullability declarations across the codebase • non-null by default + individual @Nullable declarations The Java effect: nullability validation in IntelliJ IDEA and Eclipse • allowing applications to validate their own interaction with Spring APIs The Kotlin effect: straightforward assignments to non-null variables • Kotlin compiler only allows such assignments for APIs with clear nullability Currently directly supported + JSR-305 meta-annotations • collaboration on common code analysis annotations with Google & JetBrains 4 
  • 5. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Programmatic Lookup via ObjectProvider @Autowired ObjectProvider<Foo> foo ObjectProvider<Foo> foo = ctx.getBeanProvider(Foo.class) ObjectProvider methods with nullability declarations ● @Nullable T getIfAvailable() ● @Nullable T getIfUnique() Overloaded variants with java.util.function callbacks (new in 5.0) ● T getIfAvailable(Supplier<T> defaultSupplier) ● void ifAvailable(Consumer<T> dependencyConsumer) ● T getIfUnique(Supplier<T> defaultSupplier) ● void ifUnique(Consumer<T> dependencyConsumer) 5 
  • 6. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Bean Stream Retrieval via ObjectProvider @Autowired ObjectProvider<Foo> foo ObjectProvider<Foo> foo = ctx.getBeanProvider(Foo.class) Individual object retrieval (primary/unique) ● T getObject() ● @Nullable T getIfAvailable() ● @Nullable T getIfUnique() Iteration and stream retrieval (new in 5.1) ● Iterator<T> iterator() ● Stream<T> stream() ● Stream<T> orderedStream() 6 
  • 7. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Programmatic Bean Registration with Java 8 // Starting point may also be AnnotationConfigApplicationContext GenericApplicationContext ctx = new GenericApplicationContext(); ctx.registerBean(Foo.class); ctx.registerBean(Bar.class, () -> new Bar(ctx.getBean(Foo.class))); // Or alternatively with some bean definition customizing GenericApplicationContext ctx = new GenericApplicationContext(); ctx.registerBean(Foo.class, Foo::new); ctx.registerBean(Bar.class, () -> new Bar(ctx.getBeanProvider(Foo.class)), bd -> bd.setLazyInit(true)); 7 
  • 8. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Programmatic Bean Registration with Kotlin // Java-style usage of Spring's Kotlin extensions val ctx = GenericApplicationContext() ctx.registerBean(Foo::class) ctx.registerBean { Bar(it.getBean(Foo::class)) } // Gradle-style usage of Spring's Kotlin extensions val ctx = GenericApplicationContext { registerBean<Foo>() registerBean { Bar(it.getBean<Foo>()) } } 8 
  • 9. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Performance Tuning
  • 10. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Component Scanning Classpath scanning on startup may be slow • <context:component-scan> or @ComponentScan • file system traversal of all packages within the specified base packages The common solution: narrow your base packages • Spring only searches within the specified roots in the classpath • alternatively: fully enumerate your component classes (no scanning at all) New variant since 5.0: a build-time annotation processor • spring-context-indexer generates META-INF/spring.components per jar • automatically used at runtime for compatible component-scan declarations 1 0 
  • 11. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Annotation Processing New MergedAnnotations API in 5.2 • sophisticated introspection of meta-annotation arrangements • backing Spring's common AnnotationUtils and AnnotatedElementUtils now Enabling a custom annotation registry • registering presence/absence of certain annotations per component class • bean post-processors avoid unnecessary introspection of methods/fields Integration with indexers (e.g. Jandex) ? • adapting index metadata to Spring's annotation lookup facilities on startup • however, prototyping efforts did not lead to significant gains yet 11 
  • 12. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Component Model Implications Most efficient: purely programmatic functional registration • no component scanning, no reflective factory methods • no annotation-config setup (no annotation post-processors) @Configuration(proxyBeanMethods=false) in 5.2 • same effect: @Bean methods on non-@Configuration classes • avoiding runtime generation of CGLIB subclasses • drawback: no interception of cross-@Bean method calls Prefer interface-based proxies over CGLIB proxies • again: avoiding runtime generation of CGLIB subclasses 1 2 
  • 13. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Third-Party Libraries Persistence provider bootstrapping • consider specifying an async bootstrap executor for JPA / Hibernate • Spring Data+Boot: spring.data.jpa.repositories.bootstrap-mode=deferred Hibernate ORM 5.4.5 • internal performance improvements, lower memory consumption • optional: bytecode enhancement (also for lazy loading), Jandex integration Jackson 2.9 / 2.10 • Spring Framework 5.2 requires Jackson 2.9.7+, supports Jackson 2.10 • consider Jackson’s alternative data formats: Smile, CBOR, JSON Arrays 1 3 
  • 14. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ GraalVM Native Images (experimental) Prepared for GraalVM since Spring Framework 5.1 • avoiding unnecessary internal reflection • skipping parameter name discovery As of Spring Framework 5.2: custom setup for GraalVM 19 GA • explicit reflection configuration and command line args necessary • note: Graal's SubstrateVM is still an early adopter plugin in 19 GA Expected for Spring Framework 5.3: out-of-the-box setup • automatic reflection setup through custom Graal configuration integration • https://github.com/spring-projects/spring-framework/wiki/GraalVM-native-image-support 1 4 
  • 15. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Looking Forward: OpenJDK’s Project Loom “Fibers” • lightweight user-mode threads • efficient scheduling within the JVM Classic Thread API adapted to fibers • e.g. ThreadLocal effectively “fiber-local” Fibers versus reactive programming • new life for traditional synchronous programming arrangements • reactive programming primarily for backpressure handling ? • Spring MVC versus Spring WebFlux 1 5 
  • 16. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive @ All Levels
  • 17. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive Web Results (with MVC or WebFlux) @Controller public class MyReactiveWebController { ... @GetMapping("/users/{id}") public Mono<User> getUser(@PathVariable Long id) { return this.repository.findById(id); } @GetMapping("/users") public Flux<User> getUsers() { return this.repository.findAll(); } } 1 7 
  • 18. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive Transactions (e.g. with R2DBC) @Service public class MyReactiveTransactionalService { ... @Transactional public Mono<User> getUser(Long id) { return this.repository.findById(id); } @Transactional public Flux<User> getUsers() { return this.repository.findAll(); } } 1 8 
  • 19. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive Transaction Setup ReactiveTransactionManager SPI • as an alternative to PlatformTransactionManager • relies on Reactor context instead of ThreadLocals Implementations for R2DBC, MongoDB, Neo4j • available in Spring Data Moore • also usable with programmatic TransactionalOperator Common setup through @EnableTransactionManagement • automatic adaptation to each annotated method signature • works with any Reactive Streams Publisher as return value 1 9 
  • 20. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive Messaging (e.g. with RSocket) @Controller public class MyReactiveMessagingController { ... @MessageMapping("echo-async") public Mono<String> echoAsync(String payload) { return ... } @MessageMapping("echo-channel") public Flux<String> echoChannel(Flux<String> payloads) { return ... } } 2 0 
  • 21. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive Application Events @Service public class MyReactiveApplicationEventService { ... @EventListener public Mono<MyOtherEvent> processWithResponse(MyEvent event) { return ... } @EventListener public CompletableFuture<MyOtherEvent> processAsync(MyEvent event) { return ... } } 2 1 
  • 22. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Reactive API Adapters Spring automatically adapts common reactive API types • according to return/parameter declarations in user components • org.reactivestreams.Publisher interface or library-specific API types • adapted to Reactor Flux/Mono for internal processing purposes Traditionally supported: RxJava 1 & 2, j.u.c.Flow, CompletableFuture • RxJava: Flowable, Observable, Single, Maybe, Completable • on JDK 9+: java.util.concurrent.Flow.Publisher interface New in 5.2: support for Kotlin coroutines (“suspend fun”) • Flow and Deferred return values, as exposed by Kotlin-based code 2 2 
  • 23. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Framework 5.2 Generally available now! Java 8 API Refinements Annotation Processing Reactive Transactions RSocket Messaging Kotlin Coroutines
  • 24. Unless otherwise indicated, these slides are © 2013-2019 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot 2.2 Generally available soon! Building on Spring Framework 5.2 & Spring Data Moore Stay tuned!
  • 25. Stay Connected. Related updates across the Spring portfolio... “Hello, Spring Security 5.2” (Tue 2:00pm) “What’s New in Spring Data?” (Tue 3:20pm) “Running Spring Boot Applications as GraalVM Native Images” (Tue 4:20pm) “Spring Performance Gains” (Thu 10:30am) #springone@s1p