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
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
3
200
SSMRunbook作成の勘所_20241120
koichiotomo
2
130
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
強いチームと開発生産性
onk
PRO
33
11k
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.1k
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
6
670
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
Lambdaと地方とコミュニティ
miu_crescent
2
370
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
Making your applications cross-environment - OSCG 2024 NA
salaboy
0
180
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
240
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Gamification - CAS2011
davidbonilla
80
5k
Building Your Own Lightsaber
phodgson
103
6.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Speed Design
sergeychernyshev
24
610
Music & Morning Musume
bryan
46
6.2k
Building Applications with DynamoDB
mza
90
6.1k
A Tale of Four Properties
chriscoyier
156
23k
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ʹ߹ΘͤΒΕΔͷͰίϯτ ϩʔϧ͍͢͠