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
[デザインパターン勉強会]FactoryMethodパターン
Search
mei28
August 11, 2020
45
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
[デザインパターン勉強会]FactoryMethodパターン
Seeeeee:Dの夏休み勉強会での資料.
mei28
August 11, 2020
More Decks by mei28
See All by mei28
[FAccT'26] Do User-Aligned Explanations Steer Human Decisions? Context-Dependent Influence and Ethical Implications
mei28
0
2
[Human-AI Decision Making勉強会] 説明を部分的に見せることで人に考えさせ、AIへの不適切な依存を減らす
mei28
0
130
[読み会] CHI2025論文紹介
mei28
1
88
[読み会] “Are You Really Sure?” Understanding the Effects of Human Self-Confidence Calibration in AI-Assisted Decision Making
mei28
0
180
[JSAI'24] 人間の判断根拠は文脈によって異なるのか?〜信頼されるXAIに向けた人間の判断根拠理解〜
mei28
2
890
[CHI'24] Fair Machine Guidance to Enhance Fair Decision Making in Biased People
mei28
0
130
[DEIM2024] 卓球の得点予測における重要要素の分析
mei28
0
72
[Human-AI Decision Making勉強会] 意思決定 with AIは個人vsグループで変わるの?
mei28
0
270
[読み会] Words are All You Need? Language as an Approximation for Human Similality Judgements
mei28
0
97
Featured
See All Featured
A better future with KSS
kneath
240
18k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
270
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Google's AI Overviews - The New Search
badams
0
1k
How STYLIGHT went responsive
nonsquared
100
6.2k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The Pragmatic Product Professional
lauravandoore
37
7.3k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
420
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Transcript
'BDUPSZ.FUIPE 4FFFFFF% ༶໌
w'BDUPSZ.FUIPEͰɼΫϥεͰ͏ΦϒδΣΫτʢΠϯελϯε ͷੜํ๏ʹ͍ͭͯΛߦ͏ɽ wॊೈʹΦϒδΣΫτΛੜ͢Δ͜ͱ͕ՄೳʹͳΔ wܧঝΛར༻͢Δͱ͖ʹ͏σβΠϯύλʔϯ 'BDUPSZ.FUIPEͬͯʁ 5FNQMBUF.FUIPEΛ͏ͪΐͬͱ͍͘͢ʂ
wΠϯελϯεͷੜΛɼநΫϥεʢΫϥεʣʹ͢ΔͷͰͳ͘ɼα ϒΫϥε ࢠΫϥε ʹߦ͏͜ͱͰɼੜ͢ΔΠϯελϯεΛ؆୯ʹมߋ ͢Δ͜ͱ͕Ͱ͖Δɽ wΦϒδΣΫτͷੜΛؔΛܦ༝ͯ͠ߦ͏͜ͱͰ࣮Ͱ͖Δɽ 'BDUPSZ.FUIPEͬͯʁ ࣮ͷͷΓ͔ͨ
͡Ό͋۩ମతʹ
wࠓճྉཧͷઃఆͰΛਐΊ͍ͯ͘ɽ wྉཧ͢ΔਓɼͦΕͧΕϨγϐΛݟͳ͕ΒɼʮΔˠম͘ˠࣽΔʯͷߦಈΛशಘ ͍ͯͯ͠ɼௐཧΛߦ͏ɽ wϨγϐɼ$PPLQBEΫϥγϧͳͲಉ͡৯ࡐͰҟͳΔϨγϐ͕ଘࡏ͢Δɽ ࣮ࡍʹͭͬͯ͘Έͨ ઃఆΛ֬ೝ͍ͯ͘͠Α
ॳ৺ऀ͕ௐཧ͍ͯ͘͠Α /PU'BDUPSZ.FUIPE ͱΓ͋͑ͣ$PPLQBEΛݟΔ͔ class Shoshinsya_Chouri(metaclass=ABCMeta): @abstractmethod def kiru(self): raise
NotImplemented @abstractmethod def yaku(self): raise NotImplemented @abstractmethod def nikomu(self): raise NotImplemented def chouri(self): cookpad = Cookpad(self.shokuzai) self.kiru(cookpad.recipe) self.yaku(cookpad.recipe) self.nikomu(cookpad.recipe) print("Ͱ͖ͨʂ") class Shoshinsya(Shoshinsya_Chouri): def __init__(self, shokuzai): self.shokuzai = shokuzai def kiru(self, cookpad): print(f'{cookpad}Λࢀߟʹͯ͠{self.shokuzai}ΛΔͧ') def yaku(self, cookpad): print(f'{cookpad}Λࢀߟʹͯ͠{self.shokuzai}Λম͍͍ͯ͘') def nikomu(self, cookpad): print(f'{cookpad}Λࢀߟʹͯ͠{self.shokuzai}ΛࣽࠐΉΑ') ΦϒδΣΫτͰ ϨγϐΛࢦఆͯ͠ ݟ͍ͯΔϨγϐ
ผʹ͜ΕͰΑ͘ͳ͍ʁ
Α͘ͳ͍Αʂ
w͜ͷ࣮ํ๏ͩͱɼॳ৺ऀͷௐཧํ๏Λशಘ͍ͯ͠Δਓɼ$PPLQBE͔͠Ϩγϐ ΛݟΔ͜ͱ͕Ͱ͖ͳ͘ͳͬͯ͠·͏ɽ w$PPLQBEҎ֎ݟΔΑͶʁଞͷϨγϐݟ͍ͨΑͶʁʁ Կ͕ྑ͘ͳ͍ͷ͔ $PPLQBE͔͠Ϩγϐݟͳ͍ͷʁ
ਓʹΑͬͯΈΔ Ϩγϐҧ͏ΑͶʁ
͍ΖΜͳϨγϐʹରԠ͠Α͏ 'BDUPSZ.FUIPE αϒΫϥεͰϨγϐΛੜ͍ͯ͘͠Α class Chukyusha_Chouri(metaclass=ABCMeta): #snip def chouri(self): recipe
= self.nanidetsukuru() self.kiru(recipe.recipe) self.yaku(recipe.recipe) self.nikomu(recipe.recipe) print("Ͱ͖ͨʂ") @abstractmethod def nanidetsukuru(self): raise NotImplementedError class Chukyusha(Chukyusha_Chouri): #snip def nanidetsukuru(self): return Kurashiru(self.shokuzai) αϒΫϥεʹ ·͔ͤΔ Ϋϥεʹ͞Ε ͨϨγϐΛܾΊΔ
wॳڃऀͷௐཧํ๏͔͠ձಘ͍ͯ͠ͳ͍ਓɼ$PPLQBE͔͠ϨγϐΛݟΔ͜ͱ͕Ͱ ͖ͳ͔ͨɽ w͔͠͠ɼதڃऀͷௐཧํ๏Λձಘ͍ͯ͠Δਓ$PPLQBEʹͩ͜ΘΒͳ͍ௐཧ͕Ͱ ͖Δɽ wதڃऀ͝ͱʹͦΕͧΕ͕ࣗݟΔϨγϐ͕ੜ͞ΕΔͷͰɼॊೈʹରԠͰ͖Δɽ w5FNQMBUFNFUIPEͩͱௐཧํ๏ͷΫϥεΛϨγϐ͚ͩมߋ͕ೖΔ w͔͠͠ɼ'BDUPSZͩͱͨͩαϒΫϥεͰมߋΛՃ͑ΔͷΈʂ 'BDUPSZ.FUIPEΛձಘͨ͠ྉཧਓ $PPLQBEҎ֎ϨγϐݟΕΔΑ͏ʹͳͬͨΑ
w'BDUPSZ.FUIPEɼ5FNQMBUF.FUIPEͱҧͬͯɼαϒδΣΫτͷੜαϒΫ ϥεʹͤΔΑ͏ʹ͢Δɽ wαϒΫϥε͕ΦϒδΣΫτΛੜ͢ΔͷͰɼαϒΫϥεʹࣗ༝͕૿ͯ͠৭ʑͰ ͖ΔΑ͏ʹͳΔɽ w"CTUSBDU'BDUPSZ'BDUPSZ.FUIPEΛͬͱநతʹͨ͠ͷʁ ·ͱΊ 'BDUPSZ.FUIPEʹࣗ༝Λ