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
秩序あるKotlinの拡張 / Orderly Kotlin Extensions
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
130
3リポジトリーを2ヶ月でモノレポ化した話 / How I turned 3 repositories into a monorepo in 2 months
kubode
0
230
ウォンテッドリーの「ココロオドル」モバイル開発 / Wantedly's "kokoro odoru" mobile development
kubode
2
1.3k
Firebase Dynamic Linksの代替手段を自作する / Create your own Firebase Dynamic Links alternative
kubode
0
720
技術を根付かせる / How to make technology take root
kubode
1
500
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
640
Google Play Consoleデベロッパー アカウントの確認 / Verifying your Play Console developer account
kubode
1
1.4k
Make your Android app into Multiplatform app
kubode
0
240
ウォンテッドリーにおけるモバイルアプリ開発 / iOSDC Japan 2024 Sponsor Session
kubode
1
1.5k
Other Decks in Programming
See All in Programming
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
200
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
0
140
IBM Bobを活用したレガシーアプリの最新化
oniak3ibm
PRO
1
220
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
320
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
14
5.9k
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
170
AI駆動開発を妨げる技術的負債の解消アプローチ / ai-refactoring-approach
minodriven
15
7.3k
はてなアカウント基盤 State of the Union
cockscomb
1
890
並列実装の現場、2ヶ月間実務でAIを使い倒したAIもPCも私も限界が近い
ming_ayami
0
130
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
220
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
180
AI 輔助遺留系統現代化的經驗分享
jame2408
1
1k
Featured
See All Featured
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
The Curious Case for Waylosing
cassininazir
1
400
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Bash Introduction
62gerente
615
220k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
210
A Modern Web Designer's Workflow
chriscoyier
698
190k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
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. 🙇