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
0
65
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
Tweet
Share
More Decks by Corneil du Plessis
See All by Corneil du Plessis
Sweet Streams (Are made of this)
corneil
0
47
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
320
A Kotlin DSL for finite state machines
corneil
0
690
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.2k
Logging isn't free
corneil
1
120
The JDK beyond Oracle
corneil
0
130
Spring Fu a quick introduction
corneil
1
640
Reactive Spring 5
corneil
1
150
Resilient Applications using Spring Cloud
corneil
1
120
Other Decks in Programming
See All in Programming
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
3
5.4k
VibeCoding時代のエンジニアリング
daisuketakeda
0
200
Instrumentsを使用した アプリのパフォーマンス向上方法
hinakko
0
250
2025年のz-index設計を考える
tak_dcxi
11
4.4k
note の Elasticsearch 更新系を支える技術
tchov
9
3.6k
AWS Summit Hong Kong 2025: Reinventing Programming - How AI Transforms Our Enterprise Coding Approach
dwchiang
0
140
M5UnitUnified 最新動向 2025/05
gob
0
140
バイラテラルアップサンプリング
fadis
3
520
SwiftDataのカスタムデータストアを試してみた
1mash0
0
150
iOSアプリで測る!名古屋駅までの 方向と距離
ryunakayama
0
160
Носок на сок
bo0om
0
1.3k
Orleans + Sekiban + SignalR でリアルタイムWeb作ってみた
tomohisa
0
250
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
245
12k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
5
570
Practical Orchestrator
shlominoach
187
11k
The Invisible Side of Design
smashingmag
299
50k
Embracing the Ebb and Flow
colly
85
4.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
How STYLIGHT went responsive
nonsquared
100
5.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.7k
Rails Girls Zürich Keynote
gr2m
94
13k
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Making Projects Easy
brettharned
116
6.2k
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/