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
240
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
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
アクターシステムに頼らずEvent Sourcingする方法について
j5ik2o
4
260
return文におけるstd::moveについて
onihusube
1
1.1k
Amazon S3 NYJavaSIG 2024-12-12
sullis
0
100
Security_for_introducing_eBPF
kentatada
0
110
Go の GC の不得意な部分を克服したい
taiyow
3
780
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
PHPで作るWebSocketサーバー ~リアクティブなアプリケーションを知るために~ / WebSocket Server in PHP - To know reactive applications
seike460
PRO
2
270
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
210
testcontainers のススメ
sgash708
1
120
創造的活動から切り拓く新たなキャリア 好きから始めてみる夜勤オペレーターからSREへの転身
yjszk
1
130
Featured
See All Featured
How GitHub (no longer) Works
holman
311
140k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
We Have a Design System, Now What?
morganepeng
51
7.3k
Thoughts on Productivity
jonyablonski
67
4.4k
Music & Morning Musume
bryan
46
6.2k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
GitHub's CSS Performance
jonrohan
1030
460k
The World Runs on Bad Software
bkeepers
PRO
65
11k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
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