Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Converting Java to Kotlin - Bring your own code
Search
Corneil du Plessis
July 24, 2019
Programming
82
0
Share
Converting Java to Kotlin - Bring your own code
The presentation that accompanied the workshop at I Code Java '19
Corneil du Plessis
July 24, 2019
More Decks by Corneil du Plessis
See All by Corneil du Plessis
Sweet Streams (Are made of this)
corneil
0
86
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
370
A Kotlin DSL for finite state machines
corneil
0
770
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.3k
Logging isn't free
corneil
1
150
The JDK beyond Oracle
corneil
0
150
Spring Fu a quick introduction
corneil
1
690
Reactive Spring 5
corneil
1
170
Resilient Applications using Spring Cloud
corneil
1
140
Other Decks in Programming
See All in Programming
JavaDoc 再入門
nagise
0
260
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
150
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
130
AIエージェントの隔離技術の徹底比較
kawayu
0
460
Swiftのレキシカルスコープ管理
kntkymt
0
210
Moments When Things Go Wrong
aurimas
3
140
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
530
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
170
CSC307 Lecture 17
javiergs
PRO
0
310
LLM Plugin for Node-REDの利用方法と開発について
404background
0
160
3Dシーンの圧縮
fadis
1
590
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
610
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
370
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
390
Speed Design
sergeychernyshev
33
1.8k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Why Our Code Smells
bkeepers
PRO
340
58k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
860
A Soul's Torment
seathinner
6
2.9k
Google's AI Overviews - The New Search
badams
0
1k
Transcript
Workshop Converting Java to Kotlin Corneil du Plessis @corneil Bring
your own code.
None
Agenda • Brief overview of Kotlin • Converting Ping Pong
TDD – Roman Numerals, more... • Bring your own code. • Questions and Discussions • Java Interoperability • Interesting language features
Kotlin Overview • Improve readability • Reduce cognitive load •
Functional and Object Oriented • Immutability
Kotlin – Functional and Object-Oriented
Zoom
Zoom
Zoom
Zoom
Kotlin – Functional and Object-Oriented
Kotlin – Data Class
Kotlin - Functions
Kotlin – Scope functions Name Invocation It / this Lambda
result or object let receiver.let {} it {} with with(receiver) {} this {} run receiver.run {} this {} apply receiver.apply {} this receiver also receiver.also {} it receiver
Converting code • Converting Ping Pong TDD • Strap in....
Converting – Add dependencies
Kotlin – Maven Dependencies
Kotlin – Maven Plugins • https://gist.github.com/corneil/fdbac43fbc2b0909ea0cb6a0d0fd146a
Kotlin – Maven Plugin
Kotlin – Maven Java Plugin configuration
Interesting Kotlin features – Java interoperability • @JvmName • @get:JvmName
• @set:JvmName • @JvmStatic • @JvmField • @JvmOverloads • @JvmDefault • @Throws • @JvmSuppressWildcards • @JvmMultifileClass
Kotlin - @JvmOverloads
Kotlin - Destructuring Declarations
Kotlin – Delegated Properties • lazy • Non-Primitives. • notNull
• Primitives • observable • Lambda is invoked when modified • vetoable • Lambda can prevent an update by returning false
Kotlin –Delegated Properties
Kotlin - Delegation
Resources • Kotlin https://kotlinlang.org/ • Kotlin Reference https://kotlinlang.org/docs/reference/ • Kotlin
Playground https://play.kotlinlang.org/ • Tutorials https://kotlinlang.org/docs/tutorials/ • More https://kotlinlang.org/docs/resources.html • Awesome Kotlin https://kotlin.link/