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
81
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
82
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
From Formal Specification to Property Based Test
ohbarye
0
2.6k
Structured Concurrency, Scoped Values and Joiners in the JDK 25 26 27
josepaumard
1
150
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
430
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
決定論 vs 確率論:Gemini 3 FlashとTF-IDFを組み合わせた「法規判定エンジン」の構築
shukob
0
160
継続的な負荷検証を目指して
pyama86
3
1.2k
開発とはなにか、Essenceカーネルで見えるもの
ukin0k0
0
170
Road to RubyKaigi: Play Hard(ware)
makicamel
1
580
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
390
20260514_its_the_context_window_stupid.pdf
heita
0
1k
AI Agent と正しく分析するための環境作り
yoshyum
2
490
実用!Hono RPC2026
yodaka
2
310
Featured
See All Featured
WCS-LA-2024
lcolladotor
0
590
Site-Speed That Sticks
csswizardry
13
1.2k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
420
The Limits of Empathy - UXLibs8
cassininazir
1
330
Unsuck your backbone
ammeep
672
58k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
530
The Language of Interfaces
destraynor
162
26k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
200
A designer walks into a library…
pauljervisheath
211
24k
Odyssey Design
rkendrick25
PRO
2
620
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.6k
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/