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
Clean Architecture
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Buzzvil
April 18, 2018
Programming
0
960
Clean Architecture
By Yohan
Buzzvil
April 18, 2018
Tweet
Share
More Decks by Buzzvil
See All by Buzzvil
220903_GFS
buzzvil
0
560
Git 해부하기 2 + 3
buzzvil
0
54
Metastable Failure
buzzvil
0
280
Git 해부하기
buzzvil
0
68
Introduction to Plate Solving
buzzvil
0
57
Airbnb Minerva
buzzvil
0
420
Shape up 방법론
buzzvil
0
1k
Buzzvil Billing Data Pipeline
buzzvil
0
650
Journey of Dash's release-cycle
buzzvil
0
220
Other Decks in Programming
See All in Programming
LLM Observabilityによる 対話型音声AIアプリケーションの安定運用
gekko0114
2
420
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
AI巻き込み型コードレビューのススメ
nealle
0
130
Smart Handoff/Pickup ガイド - Claude Code セッション管理
yukiigarashi
0
130
AI時代のキャリアプラン「技術の引力」からの脱出と「問い」へのいざない / tech-gravity
minodriven
20
6.9k
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
610
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
170
AI Schema Enrichment for your Oracle AI Database
thatjeffsmith
0
250
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
CSC307 Lecture 06
javiergs
PRO
0
680
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
527
40k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.6k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
0
310
How Software Deployment tools have changed in the past 20 years
geshan
0
32k
Exploring anti-patterns in Rails
aemeredith
2
250
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Prompt Engineering for Job Search
mfonobong
0
160
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
1
1.3k
Abbi's Birthday
coloredviolet
1
4.7k
エンジニアに許された特別な時間の終わり
watany
106
230k
A Tale of Four Properties
chriscoyier
162
24k
Transcript
None
Clean Code - quick summary • Naming • Small functions
• Meaningful comments • Data abstraction • Error Handling • TDD(Unit Tests) • Building Systems
None
Goals At working at module level, software structure should •
Tolerate changes • Easy to understand • Basic components for reuse
Our Enemies • Rigidity - difficult to change • Fragility
- easy to break • Immobility - difficult to reuse • Viscosity - resistance against making changes
SOLID Principles • Single Responsibility • Open-closed • Liskov substitution
• Interface segregation • Dependency Inversion
Single Responsibility Principle (SRP) • A module should be responsible
to one, and only one, actor
SRP: Violation Employee -regularHours +calculatePay +reportHours +save Roy John Zune
SRP: Solution Employee Facade +calculatePay +reportHours +save PayCalculator +calculatePay HourReporter
+reportHours EmployeeSaver +save
Open-closed Principle • Open for extension but closed for modification
• Example with inheritance ◦ Bad ◦ Good
Liskov Substitution Principle • If for each object o1 of
type S, there is an object o2 of type T, such that, for all programs P defined in terms of T, the behavior of P is unchanged when o1 is substituted for o2, then S is a subtype of T
None
None
LSP Violation Rectangle +setHeight +setWidth Square +setSides User
Interface Segregation Principle (ISP)
ISP Violation Ops +ops0 +ops1 +ops2 User0 User1 User2
Dependency Inversion Principle • Source code should interact with abstractions,
not concretions • Stable vs volatile concrete elements
Takeaways • Consider actors in the system • Keep options
open with layers • Interact with abstractions over details