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
980
0
Share
Clean Architecture
By Yohan
Buzzvil
April 18, 2018
More Decks by Buzzvil
See All by Buzzvil
220903_GFS
buzzvil
0
610
Git 해부하기 2 + 3
buzzvil
0
63
Metastable Failure
buzzvil
0
340
Git 해부하기
buzzvil
0
77
Introduction to Plate Solving
buzzvil
0
70
Airbnb Minerva
buzzvil
0
490
Shape up 방법론
buzzvil
0
1.1k
Buzzvil Billing Data Pipeline
buzzvil
0
700
Journey of Dash's release-cycle
buzzvil
0
260
Other Decks in Programming
See All in Programming
プロパティの順序で型推論が壊れる!? TypeScript6.0の修正からContext-Sensitivityの仕組みを追う
bicstone
2
1k
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
150
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
2.3k
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
910
AgentCore Optimizationを始めよう!
licux
4
280
開発体験を左右するライブラリの API 設計 - GraphQL スキーマ構築ライブラリから考える #tskaigi
izumin5210
2
520
~ 秘伝のタレ化した『神スプシ』と戦う ~ 関数型パラダイムで壊れない仕組みへ
h0r15h0
1
130
Talking to terminals (and how they talk back) (KotlinConf 2026)
jakewharton
PRO
1
110
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
210
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
940
20260514_its_the_context_window_stupid.pdf
heita
0
1.1k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
180
Featured
See All Featured
Claude Code のすすめ
schroneko
67
220k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
140
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Ethics towards AI in product and experience design
skipperchong
2
280
What does AI have to do with Human Rights?
axbom
PRO
1
2.2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Deep Space Network (abreviated)
tonyrice
0
150
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
150
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
54k
Fireside Chat
paigeccino
42
3.9k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
240
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