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
ViewModelはデザインパターンの夢を見るか
Search
Edward Fox
October 13, 2016
Technology
0
210
ViewModelはデザインパターンの夢を見るか
20161013
Meguro.es @ Drecom
http://meguroes.connpass.com/event/32167/
Edward Fox
October 13, 2016
Tweet
Share
More Decks by Edward Fox
See All by Edward Fox
Priorityを制するものはローディングを制す
edwardkenfox
4
590
Lambda@Edgeを利用したサードパーティJavaScriptのカナリアリリース / Canary release using Lamdba@Edge
edwardkenfox
0
69
AWS re:Invent 2019 / Hackathon for Good 参加録
edwardkenfox
2
510
Repro basketball club
edwardkenfox
0
210
Introduction to UX Optimizer
edwardkenfox
0
82
フロントエンド開発の落とし穴 / Fallacies of Client Side Programming (2019ver)
edwardkenfox
0
260
僕とprototypeとJSONで / Me and prototype down by the JSON
edwardkenfox
0
110
クライアントサイド開発の落とし穴 / Fallacies of Client Side Programming
edwardkenfox
0
350
Beacon API ことはじめ 〜そしてkeepalive fetchへ〜 / Beacon API The Basics
edwardkenfox
0
1k
Other Decks in Technology
See All in Technology
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
Taming you application's environments
salaboy
0
200
OCI Network Firewall 概要
oracle4engineer
PRO
0
4.2k
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
SDN の Hype Cycle を一通り経験してみて思うこと / Going through the Hype Cycle of SDN
mshindo
1
130
The Role of Developer Relations in AI Product Success.
giftojabu1
1
150
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
120
個人でもIAM Identity Centerを使おう!(アクセス管理編)
ryder472
4
240
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
770
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
【LT】ソフトウェア産業は進化しているのか? #Agilejapan
takabow
0
100
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
880
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
The Invisible Side of Design
smashingmag
298
50k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Music & Morning Musume
bryan
46
6.2k
A Philosophy of Restraint
colly
203
16k
GraphQLとの向き合い方2022年版
quramy
43
13k
Mobile First: as difficult as doing things right
swwweet
222
8.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Transcript
ViewModelσβΠϯ ύλʔϯͷເΛݟΔ͔ EDWARD FOX @Meguro.es 2016/10/13
Edward Fox - Developer @ Repro Inc. - RoR, JavaScript,
AWS - Vue.js 2.0, WebAssembly
repro.io ϞόΠϧΞϓϦ͚ ϚʔέςΟϯάπʔϧ
ϑϩϯτΤϯυʢVue.jsʣ ͱ όοΫΤϯυʢRailsʣ ͷ࣮ͬͯ·͢
ࠓ͢͜ͱ ϑϩϯτΛ։ൃ͍ͯ͠ΔதͰ ߟ͑ͨViewModelͷઃܭ ʹ͍ͭͯ
ࠓ͞ͳ͍͜ͱ - ಛఆͷϥΠϒϥϦͷ ࣮ڍಈ - αϯϓϧίʔυ θϩ
σβύλྑ͍
- ͷׂ - Մಡੑ - ڞ௨ͷޠኮΛఏڙ
ϑϩϯτͷϑϨʔϜϫʔΫ ϥΠϒϥϦʹύλʔϯ ͷద༻͕ଟ͘ݟΒΕΔ
1. jQuery େ͖ͳFacadeύλʔϯ
None
2. MVVMϑϨʔϜϫʔΫ Observerύλʔϯ (Pub-Subύλʔϯ)
None
όοΫΤϯυͷ࣮Λ ݟΔͱɺ༷ʑͳύλʔϯ͕ ద༻͞Ε͍ͯΔ
ϞσϧʗΫϥεɺςʔϒϧ ߏͱͳΔ͘߹கͨ͠ ϑϩϯτઃܭʹ͍ͨ͠
ߴ·ΔViewModel ίϯϙʔωϯτͷ σβύλద༻ͷػӡ
ͬͯΈͨ ը૾͖ͭϝοηʔδ ࡞ը໘
None
- ϝοηʔδͷछྨ͕બ Δ - ϓϨϏϡʔͷOS͕Γ ସ͑ΒΕΔ - ϓϨϏϡʔͷॎԣදࣔ ͕Γସ͑ΒΕΔ
1ͭ1ͭͷίϯϙʔωϯτ Λখ͘͢͞ΔͨΊʹ ׂͯ͢
༩͑ΒΕͨೖྗΛݩʹ ҟͳΔVueίϯϙʔωϯτ Λੜ͢Δ FactoryύλʔϯͬΆ͍ ࣮
None
݁Ռ
Πϕϯτࠈ
͞·͟·ͳίϯϙʔωϯτ ʹঢ়ଶ͕·͕ͨΓɺ Πϕϯτ͕ແடংʹ ඈͼ߹͏
ཁ݅ͷมߋʹ ͍͍͚ͭͯͳ͍੬͍࡞Γ
ViewModelͷσʔλ × UI্ͷૢ࡞ʹجͮ͘ঢ়ଶ × ίϯϙʔωϯτؒͷΠϕϯτ
ෳࡶੑֻ͚ࢉʹͳΔ
ViewModelʹ ద͍ͯ͠Δύλʔϯͱ ͋·Γద͞ͳ͍ύλʔϯ ͕͋Δؾ͕ͯ͘͠Δ
͋·Γద͞ͳ͍ = ෳࡶੑͱϝϯςφϯεੑ͕ Γ߹Θͳ͍
(ͪΖΜέʔεόΠέʔε)
A. ద͍ͯ͠Δύλʔϯ
- Observer - State - Messenger ͳͲ
= ৼΔ͍ʹجͮ͘ ύλʔϯ
͋·Γద͞ͳ͍ύλʔϯ
- Factory / AbstractFactory - Builder ͳͲ
= ΦϒδΣΫτͷੜʹ جͮ͘ύλʔϯ
০తͳݟͨଐੑɺ ࡉ͔͍ৼΔ͍͕มΘΔ ͜ͱ͋ͬͯɺͦͷ ΠϯλʔϑΣʔεΛ௨ͯ͠ Ϣʔβʔ͕࣮ݱ͍ͨ͜͠ͱ େ͖͘มΘΒͳ͍
ΠϯλʔϑΣʔε ͷཻͰViewModelΛׂ ͨ͠ΓɺৼΔ͍ʹ ج͍ͨύλʔϯΛద༻͢Δ
࠷ۙͷέʔε Ϣʔβʔநग़ϑΟϧλʔ ػೳͷ࣮
None
None
None
݁Ռ
- ෳࡶੑݸผͷ ίϯϙʔωϯτʹดͨ͡ - ཁ݅ͷมߋʹॊೈ ʹͳͬͨ
σϝϦοτ ݸʑͷίϯϙʔωϯτ͕ ϑΝοτʹ
·ͱΊ
ϑϩϯτͷઃܭʹ͓͍ͯɺ ViewModelͷׂ୯Ґͱ ద༻͢ΔύλʔϯͷؔΛ Α͘ߟ͑Δ
ΠϯλʔϑΣʔε ৼΔ͍ʹجཻͮ͘ Ͱߟ͑Δ
ࠓޙ
fluxΞʔΩςΫνϟͱ ΦϒδΣΫτࢦͷ ϓϥΫςΟεʹ͍ͭͯ ߟ͍͑ͨ
Thank you!