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
53
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
13
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
290
A Kotlin DSL for finite state machines
corneil
0
570
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
590
Reactive Spring 5
corneil
1
150
Resilient Applications using Spring Cloud
corneil
1
110
Other Decks in Programming
See All in Programming
Crafting Cross-Platform Adventures: Building a Game Engine with Kotlin Multiplatform
dwursteisen
0
120
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
XStateでReactに秩序を与えたい
gizm000
0
730
Jakarta EE meets AI
ivargrimstad
1
520
Rubyとクリエイティブコーディングの輪の広がり / The Growing Circle of Ruby and Creative Coding
chobishiba
1
270
From Idea to IDE: Developing Plugins for Android Studio
thisaay
1
220
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
Architecture Decision Record (ADR)
nearme_tech
PRO
1
690
Google Sign-inの移行から始めるCredential Manager活用
clockvoid
0
310
全部見せます! クラシルリワードのSwiftTesting移行プロジェクト
uetyo
0
210
LangGraphでのHuman-in-the-Loopの実装
os1ma
3
1.1k
Shinjuku.rb#95:心の技術書紹介
free_world21
1
110
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
43
2k
Designing for humans not robots
tammielis
248
25k
Robots, Beer and Maslow
schacon
PRO
157
8.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
3k
Rebuilding a faster, lazier Slack
samanthasiow
78
8.6k
Designing the Hi-DPI Web
ddemaree
278
34k
Being A Developer After 40
akosma
84
590k
Optimising Largest Contentful Paint
csswizardry
31
2.8k
The Cost Of JavaScript in 2023
addyosmani
42
5.7k
Building a Scalable Design System with Sketch
lauravandoore
459
32k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
36
1.7k
Six Lessons from altMBA
skipperchong
26
3.4k
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/