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
83
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
More Decks by Corneil du Plessis
See All by Corneil du Plessis
Sweet Streams (Are made of this)
corneil
0
91
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
380
A Kotlin DSL for finite state machines
corneil
0
780
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.3k
Logging isn't free
corneil
1
150
The JDK beyond Oracle
corneil
0
160
Spring Fu a quick introduction
corneil
1
700
Reactive Spring 5
corneil
1
170
Resilient Applications using Spring Cloud
corneil
1
140
Other Decks in Programming
See All in Programming
5分で問診!Composer セキュリティ健康診断
codmoninc
0
330
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
2
540
Terraform標準の組織で AWS CDKをどう使うか
mu7889yoon
0
280
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
250
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.8k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
260
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.5k
作るコストが小さくなった時代 幸せに働くために改めて考えたいこと 〜エンジニアとして価値を出し続けるために注視している二分野〜
yuppeeng
0
100
ローカルLLMでどこまでコードが書けるか -縮小版 / How much code can be written on a local LLM Shortened
kishida
2
190
【やさしく解説 設計編 #1】「ドメイン駆動」と「実装駆動」ってなに? 〜設計の考え方を、たとえ話で学ぼう〜
panda728
PRO
1
120
なぜ型を書くのか? TSKaigi2026で改めて考える #tskaigi_smarthr
kajitack
0
380
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Cult of Friendly URLs
andyhume
79
6.9k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
390
How to Talk to Developers About Accessibility
jct
2
400
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
200
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
320
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
Chasing Engaging Ingredients in Design
codingconduct
0
240
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/