odessa jug - spring boot & kotlin, a match made in heaven
TRANSCRIPT
SPRING BOOT AND KOTLIN, A MATCH MADE IN HEAVEN@NICOLAS_FRANKEL
ME, MYSELF AND I
@nicolas_frankel #kotlin #springboot 2
By day
• Consultant
By night
• Developer
• Blogger
• Book author
• Teacher/trainer
HYBRIS, AN SAP COMPANY
@nicolas_frankel #kotlin #springboot 3
@nicolas_frankel #kotlin #springboot 4
@nicolas_frankel #kotlin #springboot 5
WHY SPRING BOOT?
@nicolas_frankel #kotlin #springboot 6
Convention over configuration
• Kickstart a project in minutes, not days
Out-of-the-box features
•Actuator
@nicolas_frankel #kotlin #springboot 7
@nicolas_frankel #kotlin #springboot 8
KOTLIN
@nicolas_frankel #kotlin #springboot 9
Open Source
Compiles to
• JVM bytecode
• JavaScript
•Native (experimental)
A "simpler Scala"
@nicolas_frankel #kotlin #springboot
KOTLIN MAIN FEATURES
@nicolas_frankel #kotlin #springboot 10
Functional and object-oriented
Statically typed
Null safety
No checked exceptions
Named & optional arguments
Lambdas
Extension functions
Java compatibility
(And more...)
@nicolas_frankel #kotlin #springboot
KOTLIN MAIN BENEFITS
@nicolas_frankel #kotlin #springboot 11
More expressive than Java
Improved OO
Functional too
HELLO KOTLIN!
package hello // no semicolons
// namespace-level functions
// types on the right
// no special syntax for arrays
// optional return type
fun main(args: Array<String>) {
println("Hello Kotlin!")
}
@nicolas_frankel #kotlin #springboot 12@nicolas_frankel #kotlin #springboot
THE KILLER FEATURE: EXTENSIONS
@nicolas_frankel #kotlin #springboot 13
Extension methods
Extension properties
EXTENSION METHOD
@nicolas_frankel #kotlin #springboot
Add new methods on an existing type
Called like a method on the type
Translated to static Utilmethod in the bytecode
14
ENOUGH TALK…
@nicolas_frankel #kotlin #springboot 15
SPRING WEB 5 FUNCTIONAL & KOTLIN
@nicolas_frankel #kotlin #springboot 16
KEY TAKEAWAY
@nicolas_frankel #kotlin #springboot 17
Q&A
@nicolas_frankel #kotlin #springboot
http://blog.frankel.ch/
@nicolas_frankel
http://frankel.in/
https://git.io/vVSLG
18