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
910
Clean Architecture
By Yohan
Buzzvil
April 18, 2018
Tweet
Share
More Decks by Buzzvil
See All by Buzzvil
220903_GFS
buzzvil
0
330
Git 해부하기 2 + 3
buzzvil
0
16
Metastable Failure
buzzvil
0
140
Git 해부하기
buzzvil
0
27
Introduction to Plate Solving
buzzvil
0
9
Airbnb Minerva
buzzvil
0
180
Shape up 방법론
buzzvil
0
790
Buzzvil Billing Data Pipeline
buzzvil
0
420
Journey of Dash's release-cycle
buzzvil
0
130
Other Decks in Programming
See All in Programming
ゆるい個人開発のススメ
kuroppe1819
10
1k
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
250
エンターテイメント業界で利用されるAWS
demuyan
0
210
Node.js v22 で変わること
yosuke_furukawa
PRO
10
3.5k
[技育CAMPアカデミア]アイディアを形に!【超入門】スマホアプリ開発〜リリースまでの流れをご紹介
teamlab
PRO
0
380
TCAとKMPを用いた新規動画配信アプリ 「ABEMA Live」の設計
tomu28
1
120
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
7
950
Tailwind CSSを本気でカスタマイズする方法
fsubal
14
5.3k
Git Lint
bkuhlmann
4
750
新宿ダンジョンを可視化してみた
satoshi7190
2
270
Ruby Pattern Matching
bkuhlmann
0
930
Ruby Function Composition
bkuhlmann
1
330
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
Learning to Love Humans: Emotional Interface Design
aarron
267
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Designing the Hi-DPI Web
ddemaree
276
33k
Docker and Python
trallard
34
2.7k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
RailsConf 2023
tenderlove
4
540
Infographics Made Easy
chrislema
238
18k
It's Worth the Effort
3n
180
27k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Designing with Data
zakiwarfel
96
4.8k
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