Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
[作成途中]Unity設計勉強会 ポリモーフィズム編 / Unity Architecture...
Search
Ryo Yamamoto
September 05, 2019
Programming
0
49
[作成途中]Unity設計勉強会 ポリモーフィズム編 / Unity Architecture Polymophism
Ryo Yamamoto
September 05, 2019
Tweet
Share
More Decks by Ryo Yamamoto
See All by Ryo Yamamoto
Unity設計勉強会 単一責任原則編 / Unity Architecture SRP
ryo24
0
69
3 Education Topics For LightningTalk
ryo24
1
29
Presentationに流れを作ろう
ryo24
1
67
定期発表会スライドアドバイス
ryo24
0
53
ライトニングトークレベルアップ講座
ryo24
1
120
Other Decks in Programming
See All in Programming
Navigating Dependency Injection with Metro
l2hyunwoo
1
140
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
370
認証・認可の基本を学ぼう前編
kouyuume
0
260
AIコーディングエージェント(NotebookLM)
kondai24
0
210
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.8k
Giselleで作るAI QAアシスタント 〜 Pull Requestレビューに継続的QAを
codenote
0
240
DevFest Android in Korea 2025 - 개발자 커뮤니티를 통해 얻는 가치
wisemuji
0
160
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
500
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
120
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.3k
認証・認可の基本を学ぼう後編
kouyuume
0
240
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
0
38
Test your architecture with Archunit
thirion
1
2.1k
How to build a perfect <img>
jonoalderson
0
4.6k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
0
3.3k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
54k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
220
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
340
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.8k
Mind Mapping
helmedeiros
PRO
0
35
Transcript
Date : 09/05 Time : 15:00~ Place: LiT! Osaka S.O.L.I.D
Object Oriented Design Thurs 09/05
None
ಜεΫϦϓτ Ͱͷศརͳૢ࡞ ํ๏
1PMZNPQIJTN Λ͍͜ͳ͢ʂ
S.O.L.I.D.
40-*%ݪଇ ɾ4ɿ୯Ұͷݪଇ ɾ0ɿ։์ดͷݪଇ ɾ-ɿϦείϑͷஔݪଇ ɾ*ɿΠϯλʔϑΣΠεͷݪଇ ɾ%ɿґଘੑٯసͷݪଇ
جఈΫϥεੜΫϥεͱ ަՄೳͰͳ͚ΕͳΒͳ͍ ݪଇ Ϧείϑͷஔ๏ଇ
ʁʁʁʁ
ΦϒδΣΫτ ࢦ
ؔͱมΛ ·ͱΊΔ
ܧঝͱҕৡ Ϋϥε Πϯλʔ ϑΣΠε
None
ɾΧϓηϧԽ ɹ֎෦Ϋϥε͔Β࣮ΛӅṭ͢Δ ɹˠ$ϓϩύςΟ͕ศར ɾϙϦϞʔϑΟζϜ ɹಉ໋͡ྩͰҟͳΔΦϒδΣΫτ ɹΛૢ࡞͢Δ 001ͷେཁૉ
ΧϓηϧԽ
Class Human{ public string name; public int age; } Class
Game{ Human alex = new Human(); alex.name = “Alex”; alex.age = 22; } Human bob = new Human(); alex.name = “Bob”; alex.age = -20;
ਓؒؒҧ͑Δ ͜ͱ͋Δ
BHFΛ֎͔Β ݟ͑ͳ͍Α͏ ʹ͢Δ
Class Human{ private string name; private int age; public int
GetAge(){ return age; } public void SetAge(int input){ if(input > 0){ age = input; }else{ age = 99; } }
ϑΟʔϧυQSJWBUF ϝιουQVCMJD
(FUUFS 4FUUFS
Class Human{ //লུ } Class Game{ Human alex = new
Human(); alex.SetName(“Alex”); alex.SetAge(22); Debug.Log(“Alex age: ” + alex.getAge()); }
ຖճ࡞Δͷ ͩΔ͘ͳ͍ʁ
ຖճϝιουͳͷ ͩΔ͘ͳ͍ʁ
ͦͦ ྸϑΟʔϧυ ͱͯ͠ར༻͍ͨ͠
$ ศརͳΜͰ͢
ͦΜͳػೳ͕ ͋Γ·͢
֎෦͔Βʮมʯʹݟ͑ͯ ෦͔Βʮؔʯʹݟ͑Δ ϓϩύςΟ $ͱͯ͠ͷػೳ
Class Human{ private string name; private int age; public int
GetAge(){ return age; } public void SetAge(int input){ if(input > 0){ age = input; }else{ age = 99; } }
Class Human{ private int _age; public string Name{get; set;}; public
int Age{ get{ return _age; } set{ _age = value > 0 ? value : 99; } } }
Class Human{ //লུ } Class Game{ Human alex = new
Human(); alex.SetName(“Alex”); alex.SetAge(22); Debug.Log(“Alex age: ” + alex.getAge()); }
Class Human{ //লུ } Class Game{ Human alex = new
Human(); alex.Name = “Alex”; alex.Age = 22; Debug.Log(“Alex age: ” + alex.Age); }
͖ͬ͢Γ
(BNFΫϥε "HFͷ࣮Λ ؾʹ͠ͳ͍͍ͯ͘
ΧϓηϧԽ
ϙϦϞʔ ϑΟζϜ
)VNBOΛϕʔε ʹϝϯλʔͱϝϯ όʔΛ࡞Ζ͏
)VNBOΫϥεΛ ܧঝͨ͠ϝϯλʔ Ϋϥεͱϝϯόʔ ΫϥεΛ࡞Ζ͏
Class Human{ //লུ public string Name{get; set;}; public int Age{get;
set;}; } Class Mentor: Human{ public string Area{get; set;}; public int LdCourse{get; set;}; } Class Member: Human{ public string UsingServce{get; set} public int Course{get; set;}; }
Class Game{ Human alex = new Human(); alex.Name = “Alex”;
alex.Age = 22; Mentor candy = new Mentor(); candy.Name = “Candy”; candy.Age = 22; candy.Area = “Kansai”; candy.LdCource = 3; //Unityͷ͜ͱ }
ϝϯόʔ͋Δ͋Δ ࣈͰछྨΛද͢
FOVN ͑ΔΑʁ
ಛఆͷछྨΛ·ͱΊͯදݱ ࣈʹҙຯΛͨͤΔ͜ͱ્ࢭ จࣈྻͷଧͪؒҧ્͑ࢭ FOVNྻڍܕ ࣮ଶJOUσʔλ
public enum litCourse{ iPhone, Android, Unity, WebDesign, WebService } Class
Mentor: Human{ private litCourse _course; public litCourse LdCourse{get; set;} }
Class Game{ Human alex = new Human(); alex.Name = “Alex”;
alex.Age = 22; Mentor candy = new Mentor(); candy.Name = “Candy”; candy.Age = 22; candy.Area = “Kansai”; candy.LdCource = litCourse.Unity; }
͔͜͜Βຊ
͜͜Ͱ ྫʹઓʂ
ʂ ɾγϡʔςΟϯάήʔϜΛ࡞Ζ͏ʂ ʻબϘλϯʼ ɾఢछྨ ɾยํͰ྆ํಉ࣌Ͱબ0, ɾબ࣌ͦͷݩૉͷબ͕ ɹ͔ΔΑ͏ʹ͢Δ ɹʢςΩετ͕ଟҰ൪ૣ͍ͱࢥ͍·͢ʣ ʻܾఆϘλϯʼ ɾςΩετʹબΕͨݩૉΛදࣔ͢Δ
ϝϯλʔ ϝϯόʔ ʹಉ࣌ʹ ͓ئ͍͍ͨ͠
Class Human{ //লུ public string Name{get; set;}; public int Age{get;
set;}; public int Enegy{get; set;}; //Eat Something public void Eat(){ } }
Class Mentor: Human{ public void Eat(){ food.EatRedbull(); Enegy += 20;
} } Class Member: Human{ public void Eat(){ food.EatHumburger(); Enegy += 8; } }
Class Game{ Human alex = new Human(); Mentor candy =
new Mentor(); Member drake = new Member(); alex.Eat(); drake.Eat(); }
૿͑ͨΒ Ͳ͏͢Δͷʁʁ
Class Game{ Human alex = new Human(); Mentor candy =
new Mentor(); Member drake = new Member(); Mentor elisa = new Mentor(); alex.Eat(); drake.Eat(); elisa.Eat(); }
-JTU5ͱ GPSFBDI ͍͍ͨʂ
Class Game{ Human alex = new Human(); Mentor candy =
new Mentor(); Member drake = new Member(); Mentor elisa = new Mentor(); List<Mentor> mentorList = new List<Mentor>; mentorList.add(drake); }
ϝϯόʔͱϝϯλʔΛ ಉ࣌ʹѻ͍͍ͨ
ࢠΫϥεͷมʢΠϯελϯεʣ ΫϥεͷܕʹೖՄೳ ϙϦϞʔϑΟζϜͷϙΠϯτ ܕΛ߹ΘͤΒΕΔ
ϙϦϞʔϑΟζϜͷϙΠϯτ ਓؒ ϝϯλʔ ϝϯόʔ খΫϥεඞͣΫϥεͷଐੑΛ͍࣋ͬͯΔͨΊ
Class Game{ Human alex = new Human(); Human candy =
new Mentor(); Human drake = new Member(); Human elisa = new Mentor(); List<Human> mentorList = new List<Human>; mentorList.add(drake); }
Class Game{ //alex͔Βelisa·ͰΛ࡞ͬͨ List<Human> mentorList = new List<Human>; mentorList.add(alex); //ਓؒ
mentorList.add(bob); mentorList.add(candy); //ϝϯλʔ mentorList.add(drake); //ϝϯόʔ }
Class Human{ //লུ public string Name{get; set;}; public int Age{get;
set;}; public int Enegy{get; set;}; //Eat Something public virtual void Eat(){ } }
abstract Class Human{ //লུ public string Name{get; set;}; public int
Age{get; set;}; public int Enegy{get; set;}; //Eat Something public abstract void Eat(); }
Class Mentor: Human{ public override void Eat(){ food.EatRedbull(); Enegy +=
20; } } Class Member: Human{ public override void Eat(){ food.EatHumburger(); Enegy += 8; } }
՝
࣭
ײ