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
Karin-Aleksandra Monoid
June 08, 2022
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Extending kotlinx.serialization functionality with Arrow Meta (Joker 2021/KotlinDevDay 2022)
Karin-Aleksandra Monoid
June 08, 2022
More Decks by Karin-Aleksandra Monoid
See All by Karin-Aleksandra Monoid
Treasure.map(): Functional programming in JVM-based languages
paranoidmonoid
0
340
Extending kotlinx.serialization functionality with Arrow Meta
paranoidmonoid
0
130
Functional Kotlin with Arrow (jLove 2021)
paranoidmonoid
1
250
Hands-on Arrow
paranoidmonoid
1
170
Make Tech Slides Work
paranoidmonoid
0
620
"Fun" as in "funeral": full-stack development using Kotlin JS
paranoidmonoid
0
130
Other Decks in Programming
See All in Programming
Deep dive into the select statement (GopherCon UK)
jespino
0
150
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
2k
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
370
高専キャリア LT 発表内容
crysta1221
4
4.3k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
170
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
440
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.5k
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
400
AIに既存システムを理解させる技術 ~レガシーを見捨てないハーネスエンジニアリング入門~
ochtum
0
170
生成AIで帳票OCRが「簡単に」作れる時代になった?
kon_shou
0
1.2k
プロポーザルを書いてもらう
pvcresin
0
590
Featured
See All Featured
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
310
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
67
57k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
Site-Speed That Sticks
csswizardry
13
1.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
180
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