Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Converting Java to Kotlin - Bring your own code
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Corneil du Plessis
July 24, 2019
Programming
92
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
Transcript
26 slides
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/
More Decks by Corneil du Plessis
See All by Corneil du Plessis
Sweet Streams (Are made of this)
corneil
0
110
Simplify State management in Spring Boot with HATEOAS and KFSM
corneil
0
410
A Kotlin DSL for finite state machines
corneil
0
800
KFSM - A Kotlin DSL for Finite State machines
corneil
2
1.3k
Logging isn't free
corneil
1
170
The JDK beyond Oracle
corneil
0
190
Spring Fu a quick introduction
corneil
1
710
Reactive Spring 5
corneil
1
180
Resilient Applications using Spring Cloud
corneil
1
170
Other Decks in Programming
See All in Programming
Kawaiicon: Kubernetes, it's no longer cool, but let's secure it anyway!
barnbarn
0
130
AmebaブログはKMPから卒業します
kmars0605
0
340
AI Augmentation Techniques with Liberty
ivargrimstad
1
440
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
170
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
190
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
650
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
3
1.5k
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
320
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.2k
Claude Code ハーネスDeep Dive – 君はどこまで制御する? -
takateeen_knj
6
5.3k
自作Discord音声botをLambda MicroVMsに移行した話 / Migrating My Discord Voice Bot to Lambda MicroVMs
akihisaikeda
1
310
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2k
Featured
See All Featured
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
310
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
530
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Faster Mobile Websites
deanohume
310
32k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.2k
Building the Perfect Custom Keyboard
takai
2
950
Music & Morning Musume
bryan
48
7.5k
HDC tutorial
michielstock
2
1k