Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Clean Architecture
Search
Buzzvil
April 18, 2018
Programming
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Clean Architecture
By Yohan
Buzzvil
April 18, 2018
Transcript
18 slides
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
More Decks by Buzzvil
See All by Buzzvil
220903_GFS
buzzvil
0
740
Git 해부하기 2 + 3
buzzvil
0
83
Metastable Failure
buzzvil
0
450
Git 해부하기
buzzvil
0
110
Introduction to Plate Solving
buzzvil
0
99
Airbnb Minerva
buzzvil
0
630
Shape up 방법론
buzzvil
0
1.2k
Buzzvil Billing Data Pipeline
buzzvil
0
800
Journey of Dash's release-cycle
buzzvil
0
350
Other Decks in Programming
See All in Programming
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
270
SODA - FACT BOOK(JP)
sodainc
1
40k
小さなアプリを作って公開するまで
onozaty
0
170
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
250
Seven New Principles of Software Engineering
yegor256
0
480
PumaからFalconに移行したRailsアプリケーションでの実践
falcon8823
0
380
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
2.1k
LLM 101
dalinaum
0
480
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
4.1k
オーケストレーション記述言語 Katari
yukikurage
0
250
SODA - FACT BOOK(EN)
sodainc
1
230
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
Featured
See All Featured
Side Projects
sachag
456
43k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Heart Work Chapter 1 - Part 1
lfama
PRO
11
37k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
First, design no harm
axbom
PRO
2
1.4k
Believing is Seeing
oripsolob
1
280
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
400
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
2
3.8k
Skip the Path - Find Your Career Trail
mkilby
1
290
Principles of Awesome APIs and How to Build Them.
keavy
128
18k