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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Masatoshi Kubode
June 23, 2021
Programming
1.7k
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
230
3リポジトリーを2ヶ月でモノレポ化した話 / How I turned 3 repositories into a monorepo in 2 months
kubode
0
310
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
2
1.4k
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
780
技術を根付かせる / How to make technology take root
kubode
1
540
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
700
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
1
1.5k
Make your Android app into Multiplatform app
kubode
0
270
ウォンテッドリーにおけるモバイルアプリ開発 / iOSDC Japan 2024 Sponsor Session
kubode
1
1.6k
Other Decks in Programming
See All in Programming
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.7k
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
AI時代のコードレビューは人に向けるな、仕組みに向けろ
texmeijin
5
3.7k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
34k
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
870
月間100万人のサービス刷新で、 技術選定をHonoに振り切った話
yutobara
8
6.8k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
310
APNsからLive Activityを開始する話
yumnumm
0
170
Kotlinの15年とServer-Side Kotlin
n_takehata
1
160
Simple Storage Service(S3) is not simple
iwatsukayura
0
310
HTML-in-Canvasで作る未来のWeb UI表現
clockmaker
5
5.2k
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
610
Music & Morning Musume
bryan
48
7.4k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Statistics for Hackers
jakevdp
799
230k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
530
So, you think you're a good person
axbom
PRO
2
2.2k
Mobile First: as difficult as doing things right
swwweet
225
10k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
640
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. 🙇