SlideShare ist ein Scribd-Unternehmen logo
1 von 14
Clean Architecture 紹介
MOKYN
渡辺俊一郎
読んでみました
本の構成
第I部 イントロダクション
第1章 設計とアーキテクチャ
第2章 2つの価値のお話
第II部 構成要素から始めよ:プログラミングパラダイム
第3章 パラダイムの概要
第4章 構造化プログラミング
第5章 オブジェクト指向プログラミング
第6章 関数型プログラミング
第III部 設計の原則
第7章 SRP:単一責任の原則
第8章 OCP:オープン・クローズドの原則
第9章 LSP:リスコフの置換原則
第10章 ISP:インターフェイス分離の原則
第11章 DIP:依存関係逆転の原則
第IV部 コンポーネントの原則
第12章 コンポーネント
第13章 コンポーネントの凝集性
第14章 コンポーネントの結合
第V部 アーキテクチャ
第15章 アーキテクチャとは?
第16章 独立性
第17章 バウンダリー:境界線を引く
第18章 境界の解剖学
第19章 方針とレベル
第20章 ビジネスルール
第21章 叫ぶアーキテクチャ
第22章 クリーンアーキテクチャ
第23章 プレゼンターとHumble Object
第24章 部分的な境界
第25章 レイヤーと境界
第26章 メインコンポーネント
第27章 サービス:あらゆる存在
第28章 テスト境界
第29章 クリーン組込みアーキテクチャ
第VI部 詳細
第30章 データベースは詳細
第31章 ウェブは詳細
第32章 フレームワークは詳細
第33章 事例:動画販売サイト
第34章 書き残したこと
前半は設計原則の説明
依存や境界がメイン 後半からクリーンアー
キテクチャの説明
クリーンアーキテクチャとは
以下の特性を持つアーキテクチャ
・フレームワーク非依存
・テスト可能
・UI非依存
・データベース非依存
・外部エージェント非依存
類似
ヘキサゴナルアーキテクチャ オニオンアーキテクチャDCIアーキテクチャ
いずれも「関心事の分離」という同じ目的を持っている
依存性のルール
円の外側は仕組み、内側は方針
「ソースコードの依存性は内側(上位レベルの方針)だ
けに向かっていなければいけない」
外側で宣言された名前は内側では触れてはいけない
円の外側にあるものが内側に影響を及ぼしたくない
Enterprise Business Rules
企業(事業)全体の最重要ビジネスルールをカプセル化し
たもの
メソッドを持ったオブジェクトでも、データ構造と関数で
も構わない
事業にあるさまざまなアプリケーションから使用できるな
ら何であっても構わない
Application Business Rules
アプリケーション固有のビジネスルールが含まれる
システムのすべてのユースケースがカプセル化・実装され
ている
エンティティに入出力するデータの流れを調整し、ユース
ケースの目標を達成できるように、エンティティに最重要
ビジネスルールを使用する指示を出す。
Interface Adapters
ユースケースやエンティティに便利なフォーマットから、
データベースやウェブなどの外部エージェントに便利なフ
ォーマットにデータを変換するアダプター
例えばGUIのMVCを保持するのはこのレイヤー。Modelは
Controllerからユースケースに渡され、ユースケースから
Viewに戻される。
Frameworks & drivers
最も外側の円で、フレームワークやツールで構成される
通常、このレイヤーにはコードをあまり書かない。書いて
も内側とやり取りするグルーコードくらい。
典型的なシナリオ
←データベースを使ったウェブベースのJavaシステム
すべてが依存性のルールに従い、内側に向かって境界
線を越えている
Interface
Adapter
Application
BusinessRule
Enterprise
BusinessRule
Framework
& Drivers
シーケンス
Use Case
Interactor
Use Case
Output Port
Use Case
Input Port
PresenterController
input
input
処理
output
output
表示
UseCaseはControllerの変更の影響を受けない Observer
クリーン組み込みアーキテクチャ
ソフトウェア
OSAL(OS抽象化レイヤー)
OS
HAL(ハードウェア抽象化レイヤー)
ファームウェア
ハードウェア
主なレイヤーに抽象化レイヤーを追加
ソフトはOSに依存しないようにする。またOSはファームウ
ェアに依存しないようにする。
モジュールは個別にテスト可能にする
参考
本家:The Clean Code Blog by Robert C. Martin (Uncle Bob)
https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
まだMVC,MVP,MVVMで消耗してるの? iOS Clean Architectureについて
https://qiita.com/koutalou/items/07a4f9cf51a2d13e4cdc
実装クリーンアーキテクチャ
https://qiita.com/nrslib/items/a5f902c4defc83bd46b8
実践クリーンアーキテクチャ
https://nrslib.com/clean-architecture/

Weitere ähnliche Inhalte

Empfohlen

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Clean architecture 紹介