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
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
510
Git 해부하기 2 + 3
buzzvil
0
49
Metastable Failure
buzzvil
0
270
Git 해부하기
buzzvil
0
60
Introduction to Plate Solving
buzzvil
0
50
Airbnb Minerva
buzzvil
0
380
Shape up 방법론
buzzvil
0
990
Buzzvil Billing Data Pipeline
buzzvil
0
600
Journey of Dash's release-cycle
buzzvil
0
210
Other Decks in Programming
See All in Programming
アーキテクチャと考える迷子にならない開発者テスト
irof
9
3.4k
2025 컴포즈 마법사
jisungbin
0
150
Stay Hacker 〜九州で生まれ、Perlに出会い、コミュニティで育つ〜
pyama86
2
2.8k
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
120
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
500
Feature Flags Suck! - KubeCon Atlanta 2025
phodgson
0
180
レイトレZ世代に捧ぐ、今からレイトレを始めるための小径
ichi_raven
0
470
乱雑なコードの整理から学ぶ設計の初歩
masuda220
PRO
32
15k
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
580
『実践MLOps』から学ぶ DevOps for ML
nsakki55
2
480
しっかり学ぶ java.lang.*
nagise
1
460
海外登壇の心構え - コワクナイヨ - / how to prepare for a presentation abroad
kishida
2
100
Featured
See All Featured
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.5k
Context Engineering - Making Every Token Count
addyosmani
9
420
Designing for humans not robots
tammielis
254
26k
Embracing the Ebb and Flow
colly
88
4.9k
Site-Speed That Sticks
csswizardry
13
970
Bootstrapping a Software Product
garrettdimon
PRO
307
110k
Mobile First: as difficult as doing things right
swwweet
225
10k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.2k
Why Our Code Smells
bkeepers
PRO
340
57k
Java REST API Framework Comparison - PWX 2021
mraible
34
9k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
22k
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