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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Corneil du Plessis
July 24, 2019
Programming
0
78
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
68
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
360
A Kotlin DSL for finite state machines
corneil
0
760
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.3k
Logging isn't free
corneil
1
140
The JDK beyond Oracle
corneil
0
140
Spring Fu a quick introduction
corneil
1
680
Reactive Spring 5
corneil
1
160
Resilient Applications using Spring Cloud
corneil
1
130
Other Decks in Programming
See All in Programming
CSC307 Lecture 08
javiergs
PRO
0
690
Premier Disciplin for Micro Frontends Multi Version/ Framework Scenarios @OOP 2026, Munic
manfredsteyer
PRO
0
200
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
820
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
180
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
310
20260228_JAWS_Beginner_Kansai
takuyay0ne
5
370
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
120
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
170
あなたはユーザーではない #PdENight
kajitack
4
290
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
370
AI巻き込み型コードレビューのススメ
nealle
2
2.4k
エージェント開発初心者の僕がエージェントを作った話と今後やりたいこと
thasu0123
0
210
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Leo the Paperboy
mayatellez
4
1.5k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.1k
It's Worth the Effort
3n
188
29k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
170
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Exploring anti-patterns in Rails
aemeredith
2
280
Designing for humans not robots
tammielis
254
26k
So, you think you're a good person
axbom
PRO
2
1.9k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
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/