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
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
150
[RubyKaigi 2026] Require Hooks
palkan
1
320
Road to RubyKaigi: Play Hard(ware)
makicamel
1
580
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
280
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
190
AI時代になぜ書くのか
mutsumix
0
400
PicoRuby for IoT: Connecting to the Cloud with MQTT
yuuu
2
770
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
400
How We Practice Exploratory Testing in Iterative Development( #scrumniigata ) / 反復開発の中で、探索的テストをどう実施しているか
teyamagu
PRO
3
840
Featured
See All Featured
Color Theory Basics | Prateek | Gurzu
gurzu
0
310
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Automating Front-end Workflow
addyosmani
1370
200k
First, design no harm
axbom
PRO
2
1.2k
Crafting Experiences
bethany
1
150
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
560
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
440
エンジニアに許された特別な時間の終わり
watany
106
240k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
180
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/