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
630
How to find problem causes and performance improvement
muumuumuumuu
6
4k
Other Decks in Technology
See All in Technology
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
終了の危機にあった15年続くWebサービスを全力で存続させる - phpcon2024
yositosi
1
760
生成AIのガバナンスの全体像と現実解
fnifni
1
180
20241214_WACATE2024冬_テスト設計技法をチョット俯瞰してみよう
kzsuzuki
3
440
kargoの魅力について伝える
magisystem0408
0
200
re:Invent 2024 Innovation Talks(NET201)で語られた大切なこと
shotashiratori
0
310
GitHub Copilot のテクニック集/GitHub Copilot Techniques
rayuron
26
11k
Wvlet: A New Flow-Style Query Language For Functional Data Modeling and Interactive Data Analysis - Trino Summit 2024
xerial
1
110
C++26 エラー性動作
faithandbrave
2
720
成果を出しながら成長する、アウトプット駆動のキャッチアップ術 / Output-driven catch-up techniques to grow while producing results
aiandrox
0
250
NilAway による静的解析で「10 億ドル」を節約する #kyotogo / Kyoto Go 56th
ytaka23
3
380
アップデート紹介:AWS Data Transfer Terminal
stknohg
PRO
0
180
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Statistics for Hackers
jakevdp
796
220k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
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ʹ߹ΘͤΒΕΔͷͰίϯτ ϩʔϧ͍͢͠