Coroutines looked interesting (as a simple alternative to RxJava) ➤ Null Safety, Immutable Data Classes, Type Inference ➤ (some features coming to Java soon) ➤ Overall Impressions ➤ “Minimally painful” ➤ Kotlin and Java interop is almost perfect ➤ Spring Boot / Kotlin interop is now relatively well supported
been official support for Kotlin ➤ Before that, there were problems with open classes and configuration properties. ➤ References ➤ https://spring.io/blog/2017/01/04/introducing-kotlin- support-in-spring-framework-5-0 ➤ https://spring.io/guides/tutorials/spring-boot-kotlin/
Classes ➤ All Kotlin classes are final by default ➤ Spring needs to extend them for AOP ➤ Declare open manually, or ➤ Import kotlin-spring plugin (recommended)
Classes ➤ After plugin, just write / use the code. ➤ Some Caveats ➤ Be careful of libraries that may require special treatment for Kotlin ➤ ex: Jackson ObjectMapper ➤ Need to configure using KotlinModule() ➤ Null Safety (talk about it later)
RPC/Rest client/server library built on top of Netty. ➤ Allows easy interface to return CompletableFutures from Controllers. ➤ In our codebase, we tend to use RxJava and Java Completable Futures in our code. ➤ What are coroutines? ➤ Kotlin’s asynchronous programming model ➤ Gives the appearance of writing imperative code, but is actually asynchronous
null. So what happens when you interact? ➤ Kotlin “assumes it is not null” but you can specify explicitly if you think it will be null. ➤ EXCEPTION: Kotlin will respect Nullable / NonNull annotations.