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
pixivアプリでマルチモジュールを実現するまで
Search
gatosyocora
March 28, 2024
Programming
1
250
pixivアプリでマルチモジュールを実現するまで
gatosyocora
March 28, 2024
Tweet
Share
More Decks by gatosyocora
See All by gatosyocora
デザインシステムcharcoalとJetpack Compose
gatosyocora
1
170
Other Decks in Programming
See All in Programming
情報漏洩させないための設計
kubotak
5
1.3k
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
550
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
6
1.4k
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
4
1.1k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
Amazon Nova Reelの可能性
hideg
0
200
月刊 競技プログラミングをお仕事に役立てるには
terryu16
1
1.2k
テストコード書いてみませんか?
onopon
2
340
Package Traits
ikesyo
1
210
為你自己學 Python
eddie
0
520
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
130
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.1k
KATA
mclloyd
29
14k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
3
240
What's in a price? How to price your products and services
michaelherold
244
12k
It's Worth the Effort
3n
183
28k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
A designer walks into a library…
pauljervisheath
205
24k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Music & Morning Musume
bryan
46
6.3k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
Mobile First: as difficult as doing things right
swwweet
222
9k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Transcript
gatosyocora pixivΞϓϦͰϚϧνϞδϡʔϧΛ࣮ݱ͢Δ·Ͱ
ΞδΣϯμ 1. ϚϧνϞδϡʔϧͱ 2. pixivΞϓϦͷϚϧνϞδϡʔϧ 3. pixivΞϓϦνʔϜͰͷϚϧνϞδϡʔϧԽͷਐΊํ
ࣗݾհ • 2021৽ଔೖࣾ • AndroidΤϯδχΞ • pixiv AndroidΞϓϦ gatosyocora
ϚϧνϞδϡʔϧͱ
ϞδϡʔϧԽ • ίʔυϕʔεͷ݁ͼ͖ͭΛऑΊɺࣗݾ݁ܕͷ෦ͷฤʹ͢Δ͜ͱ https://developer.android.com/topic/modularization
ϞδϡʔϧԽͷར • ࠶ར༻ੑ • ݫີͳදࣔઃఆཧ • ΧελϚΠζՄೳͳ৴ • ֦ுੑ •
Φʔφʔγοϓ • Ϗϧυ࣌ؒ https://developer.android.com/topic/modularization
ϞδϡʔϧԽͷར ࠶ར༻ੑ : ಉ͡Ϟδϡʔϧ͔ΒෳͷΞϓϦΛ࡞Ͱ͖Δ • Ұ෦ػೳΛϓϩτλΠϓΞϓϦͱͯ͠ฒߦͯ͠։ൃͰ͖Δ ݫີͳදࣔઃఆཧ : ଞͷϞδϡʔϧʹެ։͢ΔൣғΛ੍ޚͰ͖Δ •
IDEͷิʹग़͖͢ީิΛߜΕɺ։ൃମݧ্͕͞ΕΔ Φʔφʔγοϓ : ίʔυͷอकɺมߋͷϨϏϡʔͳͲΛ୲͢ΔΦʔφʔΛࢦఆ • νʔϜ͝ͱʹͲͷϞδϡʔϧΛ৮Εྑ͍͔໌֬ʹͳΓɺ ਝͳ։ൃʹܨ͕Δ
pixivΞϓϦͷϚϧνϞδϡʔϧ
pixivΞϓϦ • ΠϥετɾϚϯΨɾখઆͷӾཡߘ͕Ͱ͖Δ • ৽ணɺݕࡧɺίϨΫγϣϯͳͲ༷ʑͳը໘ػೳ • MVVMΞʔΩςΫνϟ / ϨΠϠʔυΞʔΩςΫνϟ •
DIϥΠϒϥϦ Dagger HiltΛಋೖ
pixivΞϓϦͷϞδϡʔϧߏ
ެࣜਪͷΞϓϦΞʔΩςΫνϟ https://developer.android.com/topic/architecture#recommended-app-arch
pixivΞϓϦͷϞδϡʔϧߏ • appɿϧʔτͷϞδϡʔϧ • featureɿpresentationͷ࣮ • domainɿϏδωεϩδοΫσʔλϞσϧ • dataɿAPIΞΫηεDBॲཧͱDTO •
coreɿڞ௨࣮
ґଘੑͷٯస • நԽΛ۩ମతͳ࣮͔Βͤ͞Δ • HiltͰinterfaceܦ༝Ͱ༻Մೳʹ pixivΞϓϦͷϞδϡʔϧߏ @Binds @Singleton abstract fun
bindSampleRepository( sampleRepositoryImpl: SampleRepositoryImpl ): SampleRepository
pixivΞϓϦͷϞδϡʔϧͷ • Resource Pre fi xΛઃఆ • ϞδϡʔϧͷৄࡉΦʔφʔγοϓͷ໌֬Խ
Resource Pre fi xΛઃఆ • ϞδϡʔϧͷϦιʔεʹpre fi xΛཁٻ • Ϧιʔεͷஔॴ͕໌֬ʹͳΔ
• Ϧιʔε໊ͷিಥ͕ͳ͘ͳΔ pixivΞϓϦͷϞδϡʔϧͷ android { namespace ‘com.sample.app.feature.post’ resoursePre fi x ‘feature_post_’ } build.gradle
ϞδϡʔϧͷৄࡉΦʔφʔγοϓͷ໌֬Խ • ୭͕ཧ͢Δ͔Λهࡌ • ෳνʔϜͰΞϓϦ։ൃ͢Δମ੍ʹରԠ pixivΞϓϦͷϞδϡʔϧͷ # :feature:post ## ׂ
ߘը໘ͷUIΛఏڙ͢Δ ## ίʔυΦʔφʔ pixiv ΞϓϦνʔϜ ## มߋ࣌ͷҙ ಈ࡞͕มΘΔ߹A νʔϜʹڞ༗͢Δ͜ͱ README.md
pixivΞϓϦνʔϜͰͷ ϚϧνϞδϡʔϧԽͷਐΊํ
pixivΞϓϦͷϞδϡʔϧߏͷਪҠ
pixivΞϓϦͷϚϧνϞδϡʔϧԽͷਐΊํ 1. ϦϑΝϨϯε࣮Λ࡞ 2. υΩϡϝϯτԽ 3. νʔϜϝϯόʔͰ֤ࣗରԠ͍ͯ͘͠ • ϞδϡʔϧԽͷͨΊͷπʔϧ •
νʔϜඪʹڍ͛ͯਐΊΔ
pixivΞϓϦͷϞδϡʔϧԽΛνʔϜͰਐΊΔ ϞδϡʔϧԽͷͨΊͷπʔϧ • Ϟδϡʔϧ࡞πʔϧ • ϑΝΠϧͷ࡞ґଘΛՃ • settings.gradleʹՃ • resource
pre fi xͷઃఆ • string, drawableϦιʔεҠಈπʔϧ $ruby create_module.rb feature post
pixivΞϓϦͷϞδϡʔϧԽΛνʔϜͰਐΊΔ νʔϜඪʹڍ͛ͯਐΊΔ • ϞδϡʔϧԽ͢ΔϑΝΠϧͷ݅ͷඪΛཱͯΔ • ఆྫͰϞδϡʔϧԽͰ͖ͨ݅Λ֬ೝ͢Δ • ຖिϞδϡʔϧԽͷ࡞ۀΛ͢Δ࣌ؒΛઃ͚ͯਐΊΔ
·ͱΊ • ϚϧνϞδϡʔϧԽʹΑͬͯνʔϜ։ൃ͕ḿΔ • ϓϩτλΠϓΞϓϦ, IDEิީิ͔Βআ֎, ίʔυͷΦʔφʔγοϓ • pixivΞϓϦfeature, domain,
data, coreϞδϡʔϧͰߏ͞Ε͍ͯΔ • ඪઃఆ, ਐḿͷܭଌ, ิॿπʔϧͳͲͰνʔϜͰண࣮ʹਐΊͨ https://developer.android.com/topic/modularization https://developer.android.com/topic/modularization/patterns