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とReduxをAndroidアプリに導入したら
Search
Fukui Atsuko
September 01, 2017
Technology
6
4.6k
KotlinとReduxをAndroidアプリに導入したら
KotlinとReduxをAndroidアプリに導入したら
KotlinとReduxをAndroidアプリに導入して得られた知見を共有します。
Fukui Atsuko
September 01, 2017
Tweet
Share
More Decks by Fukui Atsuko
See All by Fukui Atsuko
こんな時どう書くの? 逆引きKotlin入門
muumuumuumuu
3
1.4k
Kotlin導入作戦
muumuumuumuu
4
530
Sometimes Swift confuses Kotlin engineers.
muumuumuumuu
0
660
How to find problem causes and performance improvement
muumuumuumuu
6
4.1k
Other Decks in Technology
See All in Technology
Symfony in 2025: Scaling to 0
fabpot
2
210
初めてのPostgreSQLメジャーバージョンアップ
kkato1
0
440
Road to SRE NEXT@仙台 IVRyの組織の形とSLO運用の現状
abnoumaru
0
400
Cline、めっちゃ便利、お金が飛ぶ💸
iwamot
19
19k
ルートユーザーの活用と管理を徹底的に深掘る
yuobayashi
6
730
OPENLOGI Company Profile for engineer
hr01
1
22k
サーバシステムを無理なくコンテナ移行する際に伝えたい4つのポイント/Container_Happy_Migration_Method
ozawa
1
100
スケールアップ企業のQA組織のバリューを最大限に引き出すための取り組み
tarappo
4
960
どっちの API SHOW?SharePoint 開発における SharePoint REST API Microsoft Graph API の違い / Which API show? Differences between Microsoft Graph API and SharePoint REST API
karamem0
0
110
銀行でDevOpsを進める理由と実践例 / 20250317 Masaki Iwama
shift_evolve
1
110
Dapr For Java Developers SouJava 25
salaboy
1
130
数百台のオンプレミスのサーバーをEKSに移行した話
yukiteraoka
0
680
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
22
2.6k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
30
1.1k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
331
21k
Optimizing for Happiness
mojombo
377
70k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
A Tale of Four Properties
chriscoyier
158
23k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Embracing the Ebb and Flow
colly
85
4.6k
Building an army of robots
kneath
304
45k
Adopting Sorbet at Scale
ufuk
75
9.3k
Transcript
,PUMJOͱ3FEVYΛ "OESPJEΞϓϦʹಋೖͨ͠Β 3FUUZ5FDI/JHIU!3FUUZΦϑΟε
"CPVUNF • Ҫರࢠ / Fukui Atsuko • @muumuumuumuu • Retty,
Inc. • AndroidΤϯδχΞ • ͦͷલΈࠐΈܥAndroidͷ͓ࣄ
ࠃ/P໊࣮άϧϝαʔϏε3FUUZͷӡӦ ઃཱ XFCͱΞϓϦͰαʔϏεల։ γϯάϧυϝΠϯ εϚϗϑΝʔετ ݄ؒར༻ऀສ
ͦΜͳ3FUUZͷ "OESPJEνʔϜ͕࠷ۙࢼ͍ͯ͠Δ ,PUMJOͱ3FEVYͷΈ߹Θͤ ʹ͍͓ͭͯ͠͠·͢ɻ
"HFOEB • લఏࣝ: Kotlin / Redux ʹ͍ͭͯ • ಘΒΕͨݟ •
·ͩΜͰ͍Δ෦
,PUMJO
,PUMJO • 2011ʹJetBrain͔ࣾΒൃද͞Εͨϓϩάϥ ϛϯάݴޠ • Better Java ͳݴޠ • JavaͱڞଘՄೳ
• ؔܕϓϩάϥϛϯάͷελΠϧΛαϙʔτ • ͔Θ͍͍
3FEVY
3FEVY • React js ͔Βग़͖ͯͨઃܭࢥ • Three Principles • Single
source of truth • State is read-only • Changes are made with pure functions
3FEVY
ಋೖʹ͋ͨͬͯ
3FEVY-JCSBSZ • ࣾͰ࡞ͬͯެ։͠·ͨ͠ • https://github.com/RettyEng/redux-kt • ReSwiftΛϦεϖΫτ • طଘͷLibraryݕ౼͚ͨ͠ͲσϑΝΫτ͕ͳ ͍ঢ়ଶ
%FNP
3FEVY
͠Β͘ࢼͯ͠ಘΒΕͨݟ
͕͜͜خ͍͠ • Activity/Fragment/ViewΛލ͍ͰใΛڞ༗ Ͱ͖Δ • StateͷมߋΛ͢Δ෦͕Viewͷߋ৽ͷ ͔ΒશʹͰ͖Δ • View͕Ͳ͏มΘΔ͔ؔ৺ͷର֎ •
APIίʔϧΛͨͣը໘දࣔͰ͖Δ
͍͍ͯΔαʔϏε • ෳͷը໘ͰใΛڞ༗͍ͯ͠Δ • ը໘ભҠͷύλʔϯ͕ෳ͋Δ
͍͍ͯͳ͍αʔϏε • ΞϓϦ֎͔ΒϦΞϧλΠϜʹใ͕มΘΓ͏ Δ • ෆشൃใΛͨ͘͞Μѻ͏ඞཁ͕͋Δ • State͕͖࣋ͭใͷαΠζ͕େ͖͍
,PUMJOͱ૬ੑͷྑ͞ • Stateͷ͕࣋ͭnullڐ༰͔Ͳ͏͔ίʔυͰࣔ ͤΔ • Viewଆͷίʔυ͕ॻ͖͍͢
,PUMJOͱ૬ੑͷྑ͞ • Test͕ॻ͖͍͢ • Reducer͕७ਮؔͳͷͰmockͳ͠Ͱςε τ͕ॻ͚Δ
,PUMJOͱ૬ੑͷྑ͞ • Stateͷૢ࡞͕ॻ͖͍͢ • dataΫϥεͷcopy()ϝιουͰมߋ͢ΔՕॴ Λ໌ࣔతʹࢦఆͰ͖Δ
·ͩΜͰ͍Δͱ͜Ζ
4UBUFͷ࣋ͪํ • ͲͷใΛͲ͏͍͏෩ʹStateͱͯ͠อ࣋͢Δ ͔ͱͯΉ • ͓ͦΒ͘ਖ਼ղͳ͍ • αʔϏεΞϓϦʹΑͬͯมΘͬͯ͘Δ • Ͱ։ൃऀؒͰ͋Δఔҙࣝ߹Θ͕ͤඞཁ
4UBUFͷੜଘظؒ • Applicationͱಉ͡ʢΦϯϝϞϦͳใʣ • όοΫάϥϯυʹճͬͨ࣌ʹΞϓϦϓϩηε ͕kill͞ΕΔͱҰॹʹใ͕ࣦΘΕΔ • ͍ࣦͭΘΕ͍͍ͯใ͔͠ࡌͤͳ͍ • SharedPreference͔αʔόʹୀආ͢Δ
ϝϞϦੜଘظؒ • Application͕ੜ͖͍ͯΔݶΓղ์͞Εͳ͍ ϝϞϦͨͪ • Rettyॏ͍ͨσʔλΛอ࣋͢Δέʔε͕ͳ͍ ͷͰࠓͷॴେৎ
·ͱΊ
·ͱΊ • Kotlin / Redux ͷΈ߹ΘͤΛಋೖͯ֓͠Ͷ ѱ͍ͱ͜ΖݟͨΒͣͤͰ͢ • ͨͩ͠αʔϏεͷੑ࣭ͱѻ͏σʔλʹΑΓ· ͢
• Ұࢼͯ͠ΈΔͷΞϦʂ • ͥͻLibraryͬͯΈ͍ͯͩ͘͞ʂ٩( 'ω' )و
͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ
͔͜͜Βઌ͕࣌ؒ͋Ε
'MVYʹ͠Α͏͔Ή • Reduxͱಉ͘͡σʔλͷྲྀΕ͕Ұํ௨ߦ • ReduxFlux͔Βੜͨ͠ߟ͑ํ • ͨͩ͠StoreΛෳ࣋ͪ͏Δ
'MVYʹ͠Α͏͔Ή • ActivityΛލ͕ͳ͍͚ͲɺෳͷView Component ͰใΛڞ༗͍ͨ͠ • ΞϓϦશମͷStoreʹͷͤΔใͱͯ͠ෆదͳ ؾ͕͢Δ • ୯Ұػೳ͚ͩͰ͔͠Θͳ͍Store͕ཉ͘͠ͳΔ
• ੜଘظؒActivityʹ߹ΘͤΒΕΔͷͰίϯτ ϩʔϧ͍͢͠