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
57
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
30
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
310
A Kotlin DSL for finite state machines
corneil
0
660
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.1k
Logging isn't free
corneil
1
120
The JDK beyond Oracle
corneil
0
130
Spring Fu a quick introduction
corneil
1
620
Reactive Spring 5
corneil
1
150
Resilient Applications using Spring Cloud
corneil
1
120
Other Decks in Programming
See All in Programming
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
0
210
CI改善もDatadogとともに
taumu
0
120
『GO』アプリ バックエンドサーバのコスト削減
mot_techtalk
0
150
Immutable ActiveRecord
megane42
0
140
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
120
GitHub Actions × RAGでコードレビューの検証の結果
sho_000
0
270
Honoのおもしろいミドルウェアをみてみよう
yusukebe
1
210
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
1
570
Open source software: how to live long and go far
gaelvaroquaux
0
640
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
Spring gRPC について / About Spring gRPC
mackey0225
0
220
How mixi2 Uses TiDB for SNS Scalability and Performance
kanmo
38
14k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
205
24k
Documentation Writing (for coders)
carmenintech
67
4.6k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
A better future with KSS
kneath
238
17k
Rebuilding a faster, lazier Slack
samanthasiow
80
8.8k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
30
4.6k
Adopting Sorbet at Scale
ufuk
74
9.2k
Unsuck your backbone
ammeep
669
57k
Become a Pro
speakerdeck
PRO
26
5.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/