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
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
220
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
220
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
280
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
260
クリエイティブコーディングとRuby学習 / Creative Coding and Learning Ruby
chobishiba
0
3.9k
testcontainers のススメ
sgash708
1
120
良いユニットテストを書こう
mototakatsu
7
2.2k
これが俺の”自分戦略” プロセスを楽しんでいこう! - Developers CAREER Boost 2024
niftycorp
PRO
0
190
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
たのしいparse.y
ydah
3
120
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
Featured
See All Featured
The Invisible Side of Design
smashingmag
298
50k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Documentation Writing (for coders)
carmenintech
66
4.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
A Philosophy of Restraint
colly
203
16k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Faster Mobile Websites
deanohume
305
30k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Being A Developer After 40
akosma
87
590k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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/