odessa jug - spring boot & kotlin, a match made in heaven

18
SPRING BOOT AND KOTLIN, A MATCH MADE IN HEAVEN @NICOLAS_FRANKEL

Upload: nicolas-frankel

Post on 29-Jan-2018

252 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

SPRING BOOT AND KOTLIN, A MATCH MADE IN HEAVEN@NICOLAS_FRANKEL

Page 2: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

ME, MYSELF AND I

@nicolas_frankel #kotlin #springboot 2

By day

• Consultant

By night

• Developer

• Blogger

• Book author

• Teacher/trainer

Page 3: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

HYBRIS, AN SAP COMPANY

@nicolas_frankel #kotlin #springboot 3

Page 4: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

@nicolas_frankel #kotlin #springboot 4

Page 5: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

@nicolas_frankel #kotlin #springboot 5

Page 6: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

WHY SPRING BOOT?

@nicolas_frankel #kotlin #springboot 6

Convention over configuration

• Kickstart a project in minutes, not days

Out-of-the-box features

•Actuator

Page 7: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

@nicolas_frankel #kotlin #springboot 7

Page 8: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

@nicolas_frankel #kotlin #springboot 8

Page 9: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

KOTLIN

@nicolas_frankel #kotlin #springboot 9

Open Source

Compiles to

• JVM bytecode

• JavaScript

•Native (experimental)

A "simpler Scala"

@nicolas_frankel #kotlin #springboot

Page 10: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

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

Page 11: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

KOTLIN MAIN BENEFITS

@nicolas_frankel #kotlin #springboot 11

More expressive than Java

Improved OO

Functional too

Page 12: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

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

Page 13: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

THE KILLER FEATURE: EXTENSIONS

@nicolas_frankel #kotlin #springboot 13

Extension methods

Extension properties

Page 14: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

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

Page 15: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

ENOUGH TALK…

@nicolas_frankel #kotlin #springboot 15

Page 16: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

SPRING WEB 5 FUNCTIONAL & KOTLIN

@nicolas_frankel #kotlin #springboot 16

Page 17: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

KEY TAKEAWAY

@nicolas_frankel #kotlin #springboot 17

Page 18: Odessa JUG - Spring Boot & Kotlin, a match made in Heaven

Q&A

@nicolas_frankel #kotlin #springboot

http://blog.frankel.ch/

@nicolas_frankel

http://frankel.in/

https://git.io/vVSLG

18