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
秩序あるKotlinの拡張 / Orderly Kotlin Extensions
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Masatoshi Kubode
June 23, 2021
Programming
1.6k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
秩序あるKotlinの拡張 / Orderly Kotlin Extensions
https://potatotips.connpass.com/event/214754/
Masatoshi Kubode
June 23, 2021
More Decks by Masatoshi Kubode
See All by Masatoshi Kubode
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
220
3リポジトリーを2ヶ月でモノレポ化した話 / How I turned 3 repositories into a monorepo in 2 months
kubode
0
300
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
2
1.4k
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
770
技術を根付かせる / How to make technology take root
kubode
1
530
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
690
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
1
1.5k
Make your Android app into Multiplatform app
kubode
0
260
ウォンテッドリーにおけるモバイルアプリ開発 / iOSDC Japan 2024 Sponsor Session
kubode
1
1.6k
Other Decks in Programming
See All in Programming
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.6k
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
25
10k
Ghostty + Neovimで作る 透明でカッコ良い開発環境
j341nono
0
140
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
210
すこし踏み込む CancellationToken
htkym
2
1.4k
JRuby: Past, Present, and Future
headius
0
210
SONY CISC-NEWS NWS-1750 + NWB-225 フレームバッファの NetBSD/news68k ドライバ実装 / OSC2026Hiroshima
tsutsui
0
160
AWSに止められる覚悟してますか?
morizo_1984
2
480
setup-vp GitLab対応の裏側
naokihaba
0
140
Heart of Swift Concurrency
koher
0
1.1k
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
3.8k
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5.2k
Featured
See All Featured
The browser strikes back
jonoalderson
0
1.7k
Balancing Empowerment & Direction
lara
6
1.3k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
540
From π to Pie charts
rasagy
1
380
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.3k
Optimising Largest Contentful Paint
csswizardry
37
4k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Producing Creativity
orderedlist
PRO
348
41k
Unsuck your backbone
ammeep
672
58k
Documentation Writing (for coders)
carmenintech
77
5.5k
Exploring anti-patterns in Rails
aemeredith
4
520
Transcript
©2021 Wantedly, Inc. டং͋ΔKotlinͷ֦ு potatotips #74 2021/06/23 ٱอग़խढ़
©2021 Wantedly, Inc. XXXXBOUFEMZDPNJELVCPEF
©2021 Wantedly, Inc. w JOUFSGBDFͱPCKFDU֦ுؔͰɺ֦ுʹடং ΛͨͤΔ 5-%3
©2021 Wantedly, Inc. ܦҢ
©2021 Wantedly, Inc. w ,..ʹ(SBQI2-Λಋೖ ܦҢ
©2021 Wantedly, Inc. w 3FQPTJUPSZͰϑΣονͨ͠σʔλΛอଘ͍ͨ͠ Γ͍ͨ͜ͱ อଘͨ͠Β GetUseCaseʹ ௨͞ΕΔ
©2021 Wantedly, Inc. w ෳͷGSBHNFOUΛ͏·͘อଘ͍ͨ͠ fragmentͱ • σʔλϞσϧΛஅยԽͨ͠ͷ • ಉ͡ϞσϧΛࢦ͕͢ใྔ͕ҧ͏
• ҰཡͰ࠷খݶ • ৄࡉͰ࠷େݶ Ϟσϧಉ͡ͳͷͰɺ ಉ͡ςʔϒϧʹอଘ͍ͨ͠ Γ͍ͨ͜ͱ fragment ProfileMini on Profile { userId name avatarUrl } fragment ProfileDetail on Profile { userId name avatarUrl coverImageUrl introduction tagline statement # ... all fields }
©2021 Wantedly, Inc. w ECNFSHF GSBHNFOU Έ͍ͨʹॻ͖͍ͨ w 42-%FMJHIUʹࠩΛٵऩͯ͠ɺ͍͍ײ͡ʹอଘ ͢Δػೳͳ͍
Γ͍ͨ͜ͱ
©2021 Wantedly, Inc. w ୯७ʹ֦ுΛॻ͍ͨ Ͳ͏͔ͨ͠ʁ fun Db.merge(fragment: ProfileMiniFragment) {
profilePageQueries.upsertMiniFragment( userId = UserId(fragment.userId), // ... ) }
©2021 Wantedly, Inc. fun Db.merge(fragment: ProfileMiniFragment) { profilePageQueries.upsertMiniFragment( userId
= UserId(fragment.userId), // ... ) } ໊લʹറΓ͕ͳ͍ɺ໎͏ mergeDetail, saveͱ͔ϒϨ͍͢ ҾʹറΓ͕ͳ͍ interfaceͰ੍Λ͍࣋ͨͤͨʂ
ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2021 Wantedly, Inc. JOUFSGBDF PCKFDU֦ுؔ
©2021 Wantedly, Inc. PCKFDU֦ுؔ object Foo { fun String.hello() {
println("Hello, $this") } } objectʹ֦ுؔΛ࡞Δ ී௨ͷ֦ுؔͷΑ͏ʹར༻Ͱ͖Δ import Foo.hello fun main() { "World".hello() }
©2021 Wantedly, Inc. ղܾख๏ internal interface Merger<FragmentT> { fun Db.merge(fragment:
FragmentT) } internal object ProfileMiniFragmentMerger : Merger<ProfileMiniFragment> { override fun Db.merge(fragment: ProfileMiniFragment) { profilePageQueries.upsertFragment( userId = UserId(fragment.userId), // ... ) } } // Repository fun fetchMiniList() { val miniList = api.query(GetProfileMiniListQuery()) db.transaction { miniList.forEach { db.merge(it) } } } internal object ProfileDetailFragmentMerger : Merger<ProfileDetailFragment> { override fun Db.merge(fragment: ProfileDetailFragment) { profilePageQueries.upsertFragment( userId = UserId(fragment.userId), // ... ) } } // Repository fun fetchDetail() { val detail = api.query(GetProfileDetailQuery()) db.merge(detail) } ֦ுؔΛ࣋ͭ object࣮ object֦ுؔΛݺΜͰ͍Δ
©2021 Wantedly, Inc. w JOUFSGBDFͱPCKFDU֦ுؔͰɺ֦ுʹடংΛ ͨͤΔ͜ͱ͕Ͱ͖Δ w ࠜຊతʹίʔυੜͱ͔ͰϘΠϥʔϓϨʔτΛ ݮΒ͖͢ʜ ·ͱΊ
ϖʔδλΠτϧ ϖʔδαϒλΠτϧ ©2021 Wantedly, Inc. 🙇