Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
達人に学ぶソフトウェアの構造と設計 9,10,11章
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kazuki
October 04, 2020
250
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
達人に学ぶソフトウェアの構造と設計 9,10,11章
達人に学ぶソフトウェアの構造と設計 9,10,11章
kazuki
October 04, 2020
Transcript
12 slides
クリーンアーキテクチャ 達人に学ぶソフトウェアの構造と設計 9,10,11章 kazuki ijima
9,10,11章 リスコフの置換原則(LSP) インターフェース分離の原則(ISP) 依存関係逆転の原則(DIP)
リスコフの置換原則 「ここで望まれるのは、次に述べるような置換可能な性質である:s型のオブジェクトo1の 各々に対応するT型のオブジェクトo2が1つ存在し、Tを使って定義されたプログラムPに 対してo2の代わりにo1を使ってもPの振る舞いが変わらない場合、SはTの派生型であ ると言える」
リスコフの置換原則 置換できる例 図9-1 置換できない例 図9-2
リスコフの置換原則 継承の使い方の指針 ↓ インターフェースと実装に関するソフトウェア設計の原則
リスコフの置換原則 インターフェースが置換できない例 purplecab.com/driver/bob/.... /distination/ORD purplecab.com/driver/bob/.... /dist/ORD
インターフェース分離の原則 図10-1 Userと関係ないopの変更であっても、 再コンパイル・再デプロイが必要 図10-2 インターフェースを噛ませ、Userと関係ないopの変更であれば、 再コンパイル・再デプロイが不要
インターフェース分離の原則 必要としないモジュールに依存することは一般的に有害とされる 上位のアーキテクチャレベルにおいても同様 図10-3
依存関係逆転の原則 「ソースコードの依存関係が(具象ではなく)抽象だけを参照しているもの。 それが、最も柔軟なシステムである」 具象に依存するべきではない → 変化しやすいため 変化しづらいものへの依存は許容
依存関係逆転の原則 • 変化しやすい具象クラスを参照しない ◦ 抽象インターフェースを参照する ◦ Abstract Factoryパターンを使う • 変化しやすい具象クラスを継承しない
• 具象関数をオーバーライドしない • 変化しやすい具象を名指しで参照しない
依存関係逆転の原理 Abstract Factory 具体的な実装には注目せず、インターフェースに注目する インターフェースだけを使って、具象をあつかう 処理 抽象 → 具象 依存性
具象 → 抽象 (※依存関係逆転の原則の名前の由来)
依存関係逆転の原理 具象コンポーネント
More Decks by kazuki
See All by kazuki
達人に学ぶソフトウェアの構造と設計 29,30章
kazuki_ijima_ym
0
110
達人に学ぶソフトウェアの構造と設計 19,20章
kazuki_ijima_ym
0
100
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
680
Leo the Paperboy
mayatellez
11
2.5k
Writing Fast Ruby
sferik
630
63k
The Cost Of JavaScript in 2023
addyosmani
56
10k
Testing 201, or: Great Expectations
jmmastey
46
8.4k
Practical Orchestrator
shlominoach
192
12k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
1
630
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
3k
AI: The stuff that nobody shows you
jnunemaker
PRO
12
1.3k
First, design no harm
axbom
PRO
2
1.4k