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
56
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
19
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
300
A Kotlin DSL for finite state machines
corneil
0
620
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.1k
Logging isn't free
corneil
1
110
The JDK beyond Oracle
corneil
0
120
Spring Fu a quick introduction
corneil
1
610
Reactive Spring 5
corneil
1
150
Resilient Applications using Spring Cloud
corneil
1
110
Other Decks in Programming
See All in Programming
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
180
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
선언형 UI에서의 상태관리
l2hyunwoo
0
170
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Symfony Mapper Component
soyuka
2
730
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
780
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
790
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
270
Spatial Rendering for Apple Vision Pro
warrenm
0
110
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
450
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Writing Fast Ruby
sferik
628
61k
Fireside Chat
paigeccino
34
3.1k
Making Projects Easy
brettharned
116
5.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
For a Future-Friendly Web
brad_frost
175
9.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Typedesign – Prime Four
hannesfritz
40
2.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
665
120k
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/