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
実践!「みてね」における自動生成活用例
Search
shunsuke sato
September 21, 2020
Programming
5
6.1k
実践!「みてね」における自動生成活用例
shunsuke sato
September 21, 2020
Tweet
Share
More Decks by shunsuke sato
See All by shunsuke sato
要約 "Add Live Text interaction to your app"
ushisantoasobu
1
910
ANDPAD iOS開発の生態系と課題 - 最近取り組み始めた「マルチモジュール化」について
ushisantoasobu
1
770
Summary of Diagnose unreliable code with test repetitions
ushisantoasobu
1
950
5 Tips when test fails randomly
ushisantoasobu
2
3.5k
Better Way for Test Data Generation??
ushisantoasobu
1
2.7k
iOS/Androidのサブスクリプション実装における違いをざっと振り返る
ushisantoasobu
2
1.6k
24時間でMacアプリを作ってスベってきた話
ushisantoasobu
0
2.1k
Redirectable in App?
ushisantoasobu
2
900
iOSのClean Architecture テンプレ自動生成を支える技術 / generating CA's templates
ushisantoasobu
0
280
Other Decks in Programming
See All in Programming
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
Compose 1.7のTextFieldはPOBox Plusで日本語変換できない
tomoya0x00
0
190
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
910
弊社の「意識チョット低いアーキテクチャ」10選
texmeijin
5
24k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
as(型アサーション)を書く前にできること
marokanatani
9
2.6k
役立つログに取り組もう
irof
28
9.6k
Macとオーディオ再生 2024/11/02
yusukeito
0
370
Flutterを言い訳にしない!アプリの使い心地改善テクニック5選🔥
kno3a87
1
160
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
890
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
327
38k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Become a Pro
speakerdeck
PRO
25
5k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
Statistics for Hackers
jakevdp
796
220k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
Code Review Best Practice
trishagee
64
17k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Transcript
࣮ફʂʮΈͯͶʯʹ͓͚Δࣗಈੜ׆༻ྫ !J04%$+BQBO
ࣗݾհ • ໊લ: ࠤ౻ढ़ี • TwitterͳͲ: @ushisantoasobu • ॴଐ: ʢגʣϛΫγΟ
ΈͯͶࣄۀ෦ • ։ൃ: iOSΛϝΠϯʹɺAndroid / Rails ͳͲ • झຯ: αοΧʔʢϑοταϧʣͱ ίʔώʔ
ʮΈͯͶʯͱʁ • ʮՈΞϧόϜ ΈͯͶʯʢ ւ֎ͰʮFamilyAlbumʯʣ • ࢠڙͷࣸਅಈըΛɺՈͰڞ༗͢ΔΞϓϦ • ΈͯͶͷiOSΞϓϦʹ͍ͭͯ •
։ൃ։͔࢝Β7 • ʮεϐʔυ༏ઌ < ෦తͳ࣭ʯͳ։ൃϑΣʔζ
ΞδΣϯμ • ʮࣗಈੜʯʹڵຯΛ͖͔͚࣋ͬͨͬ • ͜ͷτʔΫͰѻ͏ʮࣗಈੜʯͱ • ΈͯͶʹ͓͚Δࣗಈੜ׆༻ྫ 3ͭ • Sourcery
/ Stencil ͷجຊతͳ • Sourcery / Stencil ͷTIPS • ࣗಈੜΛ1ӡ༻ͯ͠Έͯͷॴײ • ·ͱΊ
ʮࣗಈੜʯʹڵຯΛ͖͔͚࣋ͬͨͬ IUUQTXXXZPVUVCFDPNXBUDI W5LHG0C6
ʮࣗಈੜʯʹڵຯΛ͖͔͚࣋ͬͨͬ • UIKonf 2019 ͰͷUberͷΤϯδχΞͷํʹΑΔࣗಈੜʢ”Mockolo”ʣʹ͍ͭͯͷൃද • UberͰશͯͷϓϩμΫτͰܭ230ສߦ΄Ͳͷίʔυϕʔε • ͦͷ͏ͪʮࣗಈੜʯ͞Εͨͷ
ʮࣗಈੜʯʹڵຯΛ͖͔͚࣋ͬͨͬ • UIKonf 2019 ͰͷUberͷΤϯδχΞͷํʹΑΔࣗಈੜʢ”Mockolo”ʣʹ͍ͭͯͷൃද • UberͰશͯͷϓϩμΫτͰܭ230ສߦ΄Ͳͷίʔυϕʔε • ͦͷ͏ͪʮࣗಈੜʯ͞Εͨͷ
͜ͷτʔΫͰѻ͏ʮࣗಈੜʯͱ • Ϧιʔε·ΘΓΛλΠϓηʔϑͳSwiftͷίʔυͱͯࣗ͠ಈੜ͢Δͷ • RSwift, SwiftGenͳͲ • ίʔυΛॻ͖͡ΊΔ͏͑ͰͷςϯϓϨʔτࣗಈੜ • ෳࡶͳΞʔΩςΫνϟͷಋೖ͕ҰൠతʹͳΔʹͭΕɺधཁ͕ߴ·͍ͬͯΔʁ
• ʮ͋ΔίʔυΛͱʹɺผͷίʔυΛੜ͢Δʯʢϝλϓϩάϥϛϯάʣ • Sourcery / Stencil ͳͲΛར༻͢Δ
• Ϧιʔε·ΘΓΛλΠϓηʔϑͳSwiftͷίʔυͱͯࣗ͠ಈੜ͢Δͷ • RSwift, SwiftGenͳͲ • ίʔυΛॻ͖͡ΊΔ͏͑ͰͷςϯϓϨʔτࣗಈੜ • ෳࡶͳΞʔΩςΫνϟͷಋೖ͕ҰൠతʹͳΔʹͭΕɺधཁ͕ߴ·͍ͬͯΔʁ •
ʮ͋ΔίʔυΛͱʹɺผͷίʔυΛੜ͢Δʯʢϝλϓϩάϥϛϯάʣ • Sourcery / Stencil ͳͲΛར༻͢Δ ͜ͷτʔΫͰѻ͏ʮࣗಈੜʯͱ
ΈͯͶʹ͓͚Δࣗಈੜ׆༻ྫͭ • 1. ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου • 2. DIͷґଘؔղܾ • 3. ϞοΫ
ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου • [લఏ] • ΈͯͶͰGUIΞʔΩςΫνϟʹMVPΛ࠾༻͍ͯ͠Δ • ςετΛॻ͍͍ͯΔ
͜ͷΑ͏ͳQSFTFOUFSͷςετΛॻ͍͍ͯΔ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ελϒ͕ฦ͢Ληοτ͢Δ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ςετରͷϝιουΛ࣮ߦ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ϞοΫʢzWJFXzʣ͕ਖ਼͍͠ڍಈΛ͍ͯ͠Δ͜ͱΛ֬ೝ͢Δ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ʮελϒ͕ฦ͢ʯͱʁ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
͜͜Λॻ͘ͷ͕खؒͱ͍͏՝͕νʔϜͰ͋ͬͨ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
"TTFSU͍ͯ͠ΔͷzJEz͚ͩ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
֤Entityʹରͯ͠ ʮͦΕͧΕͷܕʹରԠͨ͠”ͦΕΆ͍”σϑΥϧτҾΛ࣋ͭϏϧμʔϝιουʯΛ ςετλʔήοτʹextensionͱͯࣗ͠ಈੜ͢Δ ͱ͍͏ΞΠσΞΛࢥ͍ͭ͘ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
͜ͷΑ͏ͳ&OUJUZʹରͯ͠ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
͜ͷΑ͏ͳͷϏϧμʔϝιουΛࣗಈੜ͢Δ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
ʮͦΕͧΕͷܕʹରԠͨ͠zͦΕΆ͍zσϑΥϧτҾΛ࣋ͭϏϧμʔϝιουʯ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
͖͞΄Ͳͷςετ͕͜ͷΑ͏ʹεοΩϦॻ͚Δ ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου
%*ͷґଘؔղܾ • [લఏ] • γεςϜΞʔΩςΫνϟʹCleanArchitectureΛ࠾༻͍ͯ͠Δ • ґଘ͢ΔͷDI͍ͯ͠Δ • ґଘؔղܾͷॲཧɺखͰΰϦΰϦॻ͍͍ͯͨ •
ʢҎલαʔυύʔςΟͷϥΠϰϥϦΛར༻͍ͯͨ͠ɻ͜͜ΒΜͷܦҢʹ͍ͭͯޙड़ʣ
IUUQTTQFBLFSEFDLDPNKTTF[IPXUPNBOBHFEJXJUIPVUVTJOHFYUFSOBMMJCSBSZJOTXJGU %*ͷґଘؔղܾ
͜ͷΑ͏ͳґଘؔղܾͷίʔυΛɺ͜Ε·ͰʮखͰΰϦΰϦॻ͍͍ͯͨʯ͕ ࠓʮࣗಈੜʯ͞ΕΔΑ͏ʹͳͬͨ %*ͷґଘؔղܾ
ͦΕͧΕ%*͢Δͷʢϓϩτίϧʣʹରͯ͠ %*ͷґଘؔղܾ
ͦͷ࣮ମΛฦ͢ϑΝΫτϦʔϝιου %*ͷґଘؔղܾ
ϞοΫ • [લఏ] • DIಉ༷ɺϞοΫʮखͰΰϦΰϦʯॻ͍͍͔ͯͨ ”SwiftMockGeneratorForXcode”ʢXcode extensionʣΛར༻͍ͯͨ͠
4XJGU.PDL(FOFSBUPS'PS9DPEFͱಉ͡Α͏ͳ*'ͷͷΛࣗಈੜͯ͠Έͨ ϞοΫ
• ʢ͜ͷτʔΫ͕࠾͞Ε͔ͯΒɺSourcery / Stencil ͷ෮श͕ͯΒͬͯΈͨʣ • -> ·ͩӡ༻࢝͠Ί͔ͨΓ • ϞοΫͷࣗಈੜΛͪΌΜͱΖ͏ͱࢥͬͨΒ݁ߏ͔ͬͨ͠
• ʮࣗಈੜΛͲ͜·ͰΓ͖Δ͔ʯॏཁͳϙΠϯτͱೝࣝɻޙड़͢Δ ϞοΫ
ΈͯͶʹ͓͚Δࣗಈੜ׆༻ྫσϞΞϓϦ https://github.com/ushisantoasobu/iosdc-2020-demo
Sourcery / Stencil ͷجຊతͳઆ໌
4PVSDFSZͬͯͦͦԿʁ • SwiftͰʮ͋Δίʔυ͔ΒɺผͷίʔυΛੜ͢ΔʯʢϝλϓϩάϥϛϯάʣͨΊͷϥΠϒϥϦ • https://github.com/krzysztofzablocki/Sourcery • ʮ͋Δίʔυ͔ΒɺผͷίʔυΛੜ͢Δʯ= ҎԼͷ2ͭͷϥΠϒϥϦʹґଘ͍ͯ͠Δ • ίʔυͷղੳ
-> SourceKittenʢSourceKitʣ • ςϯϓϨʔτΤϯδϯ -> Stencil
4UFODJMͬͯͦͦԿʁ • ςϯϓϨʔτΤϯδϯ • https://github.com/stencilproject/Stencil • ʢREADMEΑΓʣSwiftGen, Kitura, Weaver, Genesis
ͳͲͰར༻͞Ε͍͍ͯΔ • Variables / Filters / Tags ʢҎ߱ͷϖʔδͰઆ໌ʣ
4UFODJMͬͯͦͦԿʁ ςϯϓϨʔτϑΝΠϧͷݟͨ͜Μͳײ͡
4UFODJMͬͯͦͦԿʁ 7BSJBCMFTදࣔ͢Δม
4UFODJMͬͯͦͦԿʁ 5BHTGPSJGͳͲͷ੍ޚߏจ
4UFODJMͬͯͦͦԿʁ 'JMUFSTมΛʮม͢Δʯͷ
4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
XcodeͰϓϩδΣΫτ࡞ͬͯɺSourceryΠϯετʔϧࡁΈͷͱ͜Ζ͔Βελʔτ ʢΠϯετʔϧʹ͍ͭͯলུɻ͜͜ͰcocoapodsͰΠϯετʔϧʣ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
l)PHFzl'VHBzͱ͍͏໊લͷͭͷTUSVDU͕ɺz&OUJUZzσΟϨΫτϦʹ͋Δͱ͢Δ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
͜ͷΑ͏ͳςϯϓϨʔτʢTUFODJMϑΝΠϧʣΛॻ͍ͯΈΔ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
શͯͷzTUSVDUzʹରͯ͠GPSϧʔϓΛճ͢ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
zTUSVDUzͷ໊લΛग़ྗ͢Δ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
TPVSDFSZίϚϯυΛ࣮ߦ͢Δ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
lTPVSDFTzҾࣗಈੜରϑΝΠϧؚ͕·ΕΔσΟϨΫτϦΛࢦఆ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
lUFNQMBUFTzҾςϯϓϨʔτϑΝΠϧΛࢦఆ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
lPVUQVUzҾͰࣗಈੜ͢ΔϑΝΠϧͷग़ྗઌΛࢦఆ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
ͦΕͧΕͷTUSVDUͷ໊લ͕ग़ྗ͞ΕͨϑΝΠϧ͕ࣗಈੜ͞Εͨ 4PVSDFSZ4UFODJMΛͬͨࣗಈੜͷୈҰา
ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
͜ͷΑ͏ͳͷΛࣗಈੜ͢ΔʹͲͷΑ͏ͳςϯϓϨʔτϑΝΠϧΛॻ͘ඞཁ͕͋Δʁ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
શͯͷTUSVDUΛGPSϧʔϓͰճͯ͠ɺϏϧμʔϝιουΛੜ͢ʢ͜͜ΒΜൺֱతγϯϓϧͳͷͰলུʣ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
TUSVDUͷશͯͷมͰGPSϧʔϓͰճ͢ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
ΦϓγϣφϧͳΒσϑΥϧτҾͷΛzOJMzͱग़ྗ͢Δ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
Ұൠతͳܕʹ͍ͭͯɺͦΕͧΕʹରԠͨ͠ʮͦΕΆ͍ʯΛσϑΥϧτҾͷͱͯ͠ग़ྗ͢Δ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
&OVNʹ͍ͭͯ࠷ॳͷΛσϑΥϧτҾͷͱͯ͠ग़ྗ͢Δɻ ͨͩ͠"TTPDJBUFE7BMVFΛͭʹରͯ͠͏·ࣗ͘ಈੜ͢Δͷ͕͔ͬͨ͠ͷͰɺ࣍ͷʮॻ͖ʯͰճආ͢ΔΑ͏ʹͨ͠ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
ࣗಈੜ͕͍͠ͷʹ͍ͭͯɺσϑΥϧτҾͷΛʮॻ͖ʯͯ͠ग़ྗ͢Δ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
Πέςͳ͍ʁͰࣗಈੜʮࣗͨͪͰίϯτϩʔϧͰ͖Δʯ෦͕ൺֱతଟ͍ͷͰ దٓճආࡦ͕ݟ͚͍ͭ͢ϝϦοτͰ͋Δͱೝ͍ࣝͯ͠Δ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
ͦΕҎ֎ผͷ&OUJUZͷͣͳͷͰɺͦΕΒʹ͍ͭͯσϑΥϧτҾͷͱͯͦ͠ͷ&OUJUZͷϏϧμʔϝιουΛग़ྗ͢Δ ʮʮελϒ͕ฦ͢ʯͷศརʙʯͷςϯϓϨʔτΛோΊͯΈΔ
4PVSDFSZ4UFODJMิ • ઌ΄ͲSourceryͷCLIΛར༻ͯࣗ͠ಈੜΛߦͳ͕ͬͨɺ࣮ࡍʹӡ༻͢Δࡍ ʮ”Run Script”ʹίϚϯυΛهड़ͯ͠Ϗϧυຖʹ࣮ߦʯͱͳΔͣ • “sources” / “templates” /
“output” ͳͲͷҾ”.sourcery.yml”ʹ·ͱΊΔ͜ͱ͕Ͱ͖Δ • ΈͯͶͰग़ྗઌ͕ෳʢΞϓϦ/ςετʣඞཁͷͨΊ”.sourcery.yml”͑ͳ͍ • ࢀߟ -> https://github.com/krzysztofzablocki/Sourcery/issues/727
Sourcery / Stencil Λ׆༻͢Δ͏͑ͰͷTIPS
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ ྫ͑͜ͷzTUSVDUz͔ΒɺଞʹͲΜͳΛࢀর͢Δ͜ͱ͕Ͱ͖Δͷʁ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ lLJOEzϓϩύςΟ͔͠ͳ͍ʁ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ l5ZQFzͱ͍͏ΫϥεΛܧঝ͍ͯ͠Δ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ lOBNFzlBMM7BSJBCMFTzlBMM.FUIPETzͳͲͷʮྑ͍ͦ͘͏ͳʯϓϩύςΟ͕͋Δ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ 1. ࣗಈੜ͍ͨ͠ͷΛΠϝʔδ͢ΔʢPlanʣ 2. υΩϡϝϯτΈͭͭɺͱΓ͋͑ͣࣗಈੜͯ͠ΈΔʢDoʣ 3. ࣗಈੜ͞ΕͨͷΛ֬ೝ͢ΔʢCheckʣ 4. Πϝʔδ͍ͯͨ͠ͷ͕ਖ਼͘͠ੜ͞Ε͍ͯͳ͔ͬͨͷͰɺ࠶υΩϡϝϯτݟ͢ʢActionʣ •
PDCAαΠΫϧΛճ͍ͯ͘͠ײ͡ʹͳΔͣ
υΩϡϝϯτͱᛀΊͬ͜͢Δඞཁ͕͋Δ • Sourcery -> https://cdn.rawgit.com/krzysztofzablocki/Sourcery/master/docs/index.html • Stencil -> https://stencil.fuller.li/en/latest/
4UFODJM4XJGU,JUΛ͓ͬͯ͘ • https://github.com/SwiftGen/StencilSwiftKit • Stencilͷ֦ுػೳΈ͍ͨͳͷ • Stenicilͷඪ४ػೳ͚ͩͰ࣮ݱͰ͖ͳ͍ͷΛ࣮ݱͰ͖Δ • Stenicilͷඪ४ػೳ͚ͩͰ࣮ݱ͢Δͷ͕େมͳͷΛ؆୯ʹ࣮ݱͰ͖Δ •
SourceryͷREADMEʹҰهड़͕ͳ͍͕ɺSourcery͔Βར༻Ͱ͖Δ • ͪ͜ΒυΩϡϝϯτΈͯɺར༻Ͱ͖ΔػೳΛѲ͓ͯ͘͠ͱྑ͍
• ಛʹ”macro”ศར • ଞʹศརͳͷ͕ͨ͘͞Μ͋Δ • “Map”ͱ͍͏tagɺ”hasPrefix”ͱ͍͏filterΈͯͶͰར༻͍ͯ͠Δ 4UFODJM4XJGU,JUΛ͓ͬͯ͘
NBDSPͷྫ 4UFODJM4XJGU,JUΛ͓ͬͯ͘
Ұ෦ͷςϯϓϨʔτΛNBDSPͱͯ͠ఆٛͰ͖Δ 4UFODJM4XJGU,JUΛ͓ͬͯ͘
NBDSPΛผͷॴ͔Βݺͼग़͢͜ͱ͕Ͱ͖Δɻ ςϯϓϨʔτΤϯδϯͷՄಡੑΛ͋͛ͨΓɺಉ͡Α͏ͳςϯϓϨʔτΛॻ͘͜ͱΛආ͚Δ͜ͱ͕Ͱ͖Δ 4UFODJM4XJGU,JUΛ͓ͬͯ͘
4PVSDFSZͷʮαϯϓϧूʯΛࢀߟʹ͢Δ IUUQTHJUIVCDPNLS[ZT[UPG[BCMPDLJ4PVSDFSZUSFFNBTUFS5FNQMBUFT5FNQMBUFT
ࣗಈੜΛͲ͜·Ͱ্͛Δ͖͔ • ࣗಈੜΛߦ͏্Ͱɺ࣮ݱ͢Δͷ͕Ͳ͏͍ͯ͠͠ίʔφʔέʔε͕Ͱ͖ͯͨͱ͖ • ͋·ΓʮؤுΓ͗͢ͳ͍ʯ͜ͱ • ʮϝϯςͰ͖ͳ͍ʯςϯϓϨʔτϑΝΠϧ࡞Γͨ͘ͳ͍ • νʔϜͰӡ༻Ͱ͖Δ͜ͱ͕ॏཁ •
ճආࡦ͋Δ • ςϯϓϨʔτଆͰճආ͢Δ -> ྫ) ʮελϒ͕ฦ͢ʯͷศརϏϧμʔϝιου • ࣗಈੜͷର͔Β֎͢ʢͦΕΒखͰॻ͘ʣ
• ࣗಈੜͷର͔Β֎͢ = ରϑΝΠϧΛʮࡉ͔͘ʯద༻͢Δ͜ͱͰ͖Δ • બύλʔϯ • ઐ༻ͷprotocolΛ࡞͠ద༻͢ΔʢͦͷprotocolΛࣗಈੜରͷҹͱ͢Δʣ • আ֎ύλʔϯ
• ʢҰൠతͰͳ͍͕ɺΈͯͶͰͪ͜ΒͰӡ༻͍ͯ͠Δʣ • আ֎͢Δ class/struct/protocolʢͳͲʣ ໊ΛςϯϓϨʔτϑΝΠϧʹʮϕλॻ͖ʯͯ͠ɺif จͳͲͰআ֎͢Δ ࣗಈੜΛͲ͜·Ͱ্͛Δ͖͔
ࡶʹ࣮ɺͦͷ͋ͱϦϑΝΫλϦϯά 1. ͪΐͬͱԚ͍͕ɺత௨Γͷͷ͕ࣗಈੜ͞ΕΔςϯϓϨʔτΛॻ͘ 2. Ұ୴ίϛοτ 3. ϦϑΝΫλ͠ͳ͕Βࣗಈੜ -> ࣗಈੜ͞ΕΔͷʹ͕ࠩͳ͚ΕOK •
ʢςετ͕͋Δ͔Β҆৺ͯ͠ϦϑΝΫλͰ͖ΔͷͱࣅͯΔʣ
1ؒӡ༻ͯ͠ΈͯͷॴײͳͲ
ಛʹେ͖ͳى͖ͨ͜ͱ͕ͳ͍ • ઌड़ͨ͠ͱ͓ΓɺҎԼͷΑ͏ͳ͜ͱ͕Ͱ͖ΔͨΊ • ςϯϓϨʔτʹԿ͔͠ΒखΛೖΕͯճආ • ࣗಈੜͷର͔Β֎͢
ࣗಈੜWTϥΠϒϥϦʁ • DIͱ͔ϞοΫʮαʔυύʔςΟͷϥΠϒϥϦΛ͑ྑ͍ͷͰʁʯͱࢥͬͨํଟ͍ͣ
• ϥΠϒϥϦͷཧίετҙ֎ʹߴ͍ • ࠷৽ͷόʔδϣϯʹै͢Δίετ • ສ͕Ұಈ͔ͳ͘ͳͬͨͱ͖/ෆ۩߹͕ग़ͨͱ͖ͷରԠίετ • ՝ղܾ͢Δ͏͑ͰɺαʔυύʔςΟͷϥΠϒϥϦΛར༻͢Δͱ͍͏બࢶͱಉʹʮࣗಈੜ ʯΛར༻͢Δͱ͍͏બࢶฒͯྑ͍ͷͰ ࣗಈੜWTϥΠϒϥϦʁ
·ͱΊ
·ͱΊ • ՝ղܾͷ1ͭͱͯ͠ʮࣗಈੜʯΛݕ౼ʹೖΕͯΈͯͲ͏͔ • ࣗಈੜΛͲ͜·ͰΓΔ͔ҙࣝ͢Δͱྑͦ͞͏
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠!!!