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
72
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
63
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
340
A Kotlin DSL for finite state machines
corneil
0
740
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.2k
Logging isn't free
corneil
1
130
The JDK beyond Oracle
corneil
0
140
Spring Fu a quick introduction
corneil
1
660
Reactive Spring 5
corneil
1
150
Resilient Applications using Spring Cloud
corneil
1
130
Other Decks in Programming
See All in Programming
Pythonスレッドとは結局何なのか? CPython実装から見るNoGIL時代の変化
curekoshimizu
5
1.7k
CSC305 Lecture 02
javiergs
PRO
1
260
CSC305 Lecture 06
javiergs
PRO
0
210
Serena MCPのすすめ
wadakatu
4
950
Advance Your Career with Open Source
ivargrimstad
0
460
Devoxx BE - Local Development in the AI Era
kdubois
0
120
monorepo の Go テストをはやくした〜い!~最小の依存解決への道のり~ / faster-testing-of-monorepos
convto
2
460
Flutterで分数(Fraction)を表示する方法
koukimiura
0
120
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
250
GraphQL×Railsアプリのデータベース負荷分散 - 月間3,000万人利用サービスを無停止で
koxya
1
1.2k
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
160
GitHub Actions × AWS OIDC連携の仕組みと経緯を理解する
ota1022
0
250
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1032
470k
Reflections from 52 weeks, 52 projects
jeffersonlam
352
21k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.7k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
45
2.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Building Applications with DynamoDB
mza
96
6.7k
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Mobile First: as difficult as doing things right
swwweet
224
10k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
32
2.3k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
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/