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
Extending kotlinx.serialization functionality w...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Karin-Aleksandra Monoid
June 08, 2022
Programming
0
120
Extending kotlinx.serialization functionality with Arrow Meta (Joker 2021/KotlinDevDay 2022)
Karin-Aleksandra Monoid
June 08, 2022
Tweet
Share
More Decks by Karin-Aleksandra Monoid
See All by Karin-Aleksandra Monoid
Treasure.map(): Functional programming in JVM-based languages
paranoidmonoid
0
330
Extending kotlinx.serialization functionality with Arrow Meta
paranoidmonoid
0
110
Functional Kotlin with Arrow (jLove 2021)
paranoidmonoid
1
220
Hands-on Arrow
paranoidmonoid
1
160
Make Tech Slides Work
paranoidmonoid
0
610
"Fun" as in "funeral": full-stack development using Kotlin JS
paranoidmonoid
0
120
Other Decks in Programming
See All in Programming
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
21
7.3k
dchart: charts from deck markup
ajstarks
3
990
24時間止められないシステムを守る-医療ITにおけるランサムウェア対策の実際
koukimiura
1
100
Fluid Templating in TYPO3 14
s2b
0
130
Oxlintはいいぞ
yug1224
5
1.3k
SourceGeneratorのススメ
htkym
0
200
AI時代の認知負荷との向き合い方
optfit
0
160
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
そのAIレビュー、レビューしてますか? / Are you reviewing those AI reviews?
rkaga
6
4.6k
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
140
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
300
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
130
Featured
See All Featured
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
AI: The stuff that nobody shows you
jnunemaker
PRO
2
260
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
Thoughts on Productivity
jonyablonski
74
5k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
A Tale of Four Properties
chriscoyier
162
24k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.2k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
67
Balancing Empowerment & Direction
lara
5
890
Transcript
1 Extending kotlinx.serialization functionality with Arrow Meta Karin-Aleksandra Monoid Kotlin
Dev Day 2022
2 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
3 • Senior Software Engineer at CircleCI • Background in
Kotlin & Scala (both front and backend) • Living in Germany with two cats • GDE in Kotlin About
4 Agenda Why? What is Arrow Meta? Sample project Showtime!
5 Project Stack • Just backend with Ktor + Arrow
• Jackson was kind of "default" • Smooth but not Kotlin-first
6 kotlinx.serialization – pros 🚀 • Kotlin-first • No boilerplate
for sealed classes
7 kotlinx.serialization – cons • Not a lot of serializers
out of the box • No global naming strategy
8 Global Naming Strategy UPPER_SNAKE_CASE -> camelCase USER_NAME -> userName
9 Jackson: Object Mapper val objectMapperUpperSnakeCase = jacksonObjectMapper().apply { propertyNamingStrategy
= PropertyNamingStrategies.UPPER_SNAKE_CASE }
10 Issue #33 https://github.com/Kotlin/kotlinx.serialization/issues/33
11 Global Naming Strategy @SerialName("USER_NAME") val userName: String
12 What is Arrow Meta?
13 “Functional companion to Kotlin's Compiler” What is Arrow Meta?
Image source: https://arrow-kt.io/
14 GIF source: https://github.com/arrow-kt/arrow-meta
15 • Already using other part of Arrow for FP
Why Arrow Meta?
16 Why Arrow Meta? • More functionality than KSP/KAPT •
Easier than kotlinc
17 Sample Project
18 https://bit.ly/3C2lHGp Link to repo
19 • various animals (actually, only cats and dogs) •
various sources (= 3rd party services) • various standards of documentation (in JSON format with different naming policies) Setting: a Zoo
20 Live coding time
21 • It works • ??? • Requires more knowledge
than expected • KSP is preferable if it fits Thoughts
22 Resources • https://meta.arrow-kt.io/ • https://github.com/arrow-kt/arrow-meta-examples • https://paranoidmonoid.github.io/articles/Kotlin%20and%20frien ds/Naming%20strategy%20plugin