Why Spring Loves Kotlin
summary
Stepwise migration from Spring Boot 1 Java + JavaScript to Spring Boot 2 pure Kotlin shows concrete wins: Kotlin-specific bytecode plugin compiler plugin auto-opens Spring-annotated classes, new top-level runApplication replaces boilerplate, Spring adds Kotlin extensions for generics and null-safety integrated with Reactor Mono/Flux, reactive Spring Data repositories are usable, coroutines support is experimental, config properties remain a pain, and Kotlin/JS plus dead-code elimination shrinks front-end output to 10 KB gzipped, a production-feasible result.
AI-written summary · about
chapters (40)
- 0:00Intro
- 0:30Today most popular way to build web applications
- 1:23Step 1
- 3:14kotlin-spring compiler plugin
- 4:07Domain model
- 5:03Spring MVC controller written in Java
- 5:20Spring MVC controller written in Kotlin
- 6:02Inferred type hints in IDEA
- 6:37Expressive test names with backticks
- 8:03Kotlin bytecode builtin in Spring JARS
- 8:40Kotlin support reference documentation
- 9:14Kotlin API documentation
- 9:40Run Spring Application with Boot 1
- 10:20Declaring additional beans
- 10:32Customizing Spring Application
- 10:49Array-like Kotlin extension for Model
- 11:48Reified type parameters Kotlin extension
- 13:23Leveraging Kotlin nullable information
- 14:54Null safety of Spring APIs
- 17:50Configuration Properties
- 20:03JUnit 5 supports non-static
- 21:14Specification like tests with Kotlin and JUnit 5
- 22:03Kotlin type-safe templates
- 24:51Reactive Streams
- 26:33WebFlux supports various async and Reactive API
- 27:15Reactor Flux is a Publisher for 0...n elements
- 27:42Reactor Mono is a Publisher for 0..1 element
- 28:19Reactive APIs are functional
- 28:45Reactor Kotlin extensions
- 29:51Spring WebFlux with annotations
- 30:24Spring & Kotlin Coroutines
- 32:42Spring WebFlux with Coroutines
- 34:11WebFlux functional API with Kotlin DSL
- 35:10Splitting router/handlers in integration in Boot
- 35:42Functional handlers
- 36:43Functional bean definition DSL
- 38:44Using bean DSL with Spring Boot
- 39:50Original JavaScript code
- 40:47Kotlin to Javascript
- 43:08Compiling Kotlin to WebAssembly instead of JavaScript
related talks
01h 05mWhy Spring Loves Kotlin
47mWhy Spring ❤ Kotlin
02h 14mFrom Spring Boot 1 in Java to Spring Boot 2 in Kotlin
52mSpring into Kotlin: How to Make the Magic even more Magical
42mThe State of Kotlin Support in Spring
33mThe State of Kotlin Support in Spring
58mSpring and Kotlin: A Winning Combination
27mState of Kotlin Support in Spring
