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
1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Clean Architecture
By Yohan
Buzzvil
April 18, 2018
More Decks by Buzzvil
See All by Buzzvil
220903_GFS
buzzvil
0
670
Git 해부하기 2 + 3
buzzvil
0
76
Metastable Failure
buzzvil
0
390
Git 해부하기
buzzvil
0
96
Introduction to Plate Solving
buzzvil
0
87
Airbnb Minerva
buzzvil
0
560
Shape up 방법론
buzzvil
0
1.1k
Buzzvil Billing Data Pipeline
buzzvil
0
740
Journey of Dash's release-cycle
buzzvil
0
300
Other Decks in Programming
See All in Programming
Webエンジニアなのにブラウザの仕組みがわからないので、Pythonで自作してみた
tatsuki12
0
170
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
340
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
730
Building a Meta Ray-Ban display app
akkeylab
0
170
仕様書を書く前にハーネスを作る - Agent Native開発は「探索を速く、判定を固く」
gotalab555
4
1.7k
源内ハンズオン概要編
hideg
0
190
片田舎のおっさん、 Swift Buildのダイアモンド問題解決の不具合修正PRを出すが、解決方法がキャッシュをしないようにすることであり、ビルド時間が伸びると言われてマージされないので高速化もする/swiftbuild
yimajo
0
190
生成AI導入の「期待外れ」を乗り越える ー 開発フロー改革が目指す、真の組織変革
starfish719
0
4.9k
実装をデザインガイドラインに追従させるための取り組み / 260731-dip-mosh-design-system
dachi023
0
6.1k
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1.1k
属人化した知識を、 AIが辿れる地図にする
pkshadeck
PRO
1
190
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
240
Featured
See All Featured
How to Ace a Technical Interview
jacobian
281
24k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
210
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
370
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
430
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
BBQ
matthewcrist
89
10k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
Designing Experiences People Love
moore
143
24k
4 Signs Your Business is Dying
shpigford
187
23k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
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