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 with Arrow Meta (Joker 2021/KotlinDevDay 2022)
Search
Karin-Aleksandra Monoid
June 08, 2022
Programming
0
80
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
280
Extending kotlinx.serialization functionality with Arrow Meta
paranoidmonoid
0
92
Functional Kotlin with Arrow (jLove 2021)
paranoidmonoid
1
180
Hands-on Arrow
paranoidmonoid
1
130
Make Tech Slides Work
paranoidmonoid
0
470
"Fun" as in "funeral": full-stack development using Kotlin JS
paranoidmonoid
0
90
Other Decks in Programming
See All in Programming
VSCodeでのDatabricks開発もお勧めしたい/I would also recommend Databricks development with VSCode.
kazumain
0
250
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
VS Code をプロダクトにどう取り込むか
onomax
1
360
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
180
Milestoner
bkuhlmann
1
410
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
670
新宿ダンジョンを可視化してみた
satoshi7190
2
240
ScalarDBを用いたマイクロサービスにおけるデータ管理 (Database Engineering Meetup #2)
scalar
0
110
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
730
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
280
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
How STYLIGHT went responsive
nonsquared
92
4.8k
In The Pink: A Labor of Love
frogandcode
138
21k
The Invisible Customer
myddelton
114
12k
Bash Introduction
62gerente
604
210k
Rebuilding a faster, lazier Slack
samanthasiow
73
8.2k
How to Ace a Technical Interview
jacobian
272
22k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
Statistics for Hackers
jakevdp
789
220k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
31
46k
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