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
Write S.O.L.I.D code
Search
Yoan
June 13, 2017
How-to & DIY
2
2.4k
Write S.O.L.I.D code
Learn how to write Object Oriented S.O.L.I.D code
Yoan
June 13, 2017
Tweet
Share
More Decks by Yoan
See All by Yoan
Clean Code du point de vue de la cognition
thirion
0
150
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
97
Cultiver l'intelligence collective à l'heure de ChatGPT
thirion
0
110
Clean Code from the Cognition Point of View
thirion
2
160
Xanpan - une méthode agile hybride centrée sur l'équipe
thirion
0
170
Les aventures d'un facilitateur au pays des techs - Agile Grenoble 2023
thirion
0
120
Clean Code du point de vue de la cognition
thirion
1
240
Les aventures d'un facilitateur au pays des techs - Agile Tour Lausanne 2022
thirion
0
180
Functional Programming made easy in C#
thirion
0
270
Other Decks in How-to & DIY
See All in How-to & DIY
miiboとamiibo繋げてみた。 #miibo #amiibo #iotlt
n0bisuke2
1
370
わたしと技術コミュニティとキャリア
kotomin_m
2
1.7k
GreenPAK 初心者向けハンズオン資料
aoisaya
2
500
#Stampfly #M5Stack 開発ストーリーと今後の可能性 前説
takasumasakazu
0
130
【加筆修正版】ハードワークを支えるフィジカルとメンタルを構築る#rubymusclemixin 活動 #きのこ2025 #きのこ2025_b
bash0c7
0
220
グローバルAWSユーザー コミュニティとJAWS-UG - JAWS FESTA 2024 in Hiroshima
awsjcpm
0
4.8k
とある航空会社の飛行機の乗り方をお教えします。/20240913-lt
kwada
3
310
JAWS-UGから学んだコミュニティの成功要因 (Success Factors)
awsjcpm
5
510
AWS Community Day 2024: Using AWS to build a launchable knowledge rocket 👉 Organize knowledge, accelerate learning and understand AI in the process
dwchiang
0
220
BlueTeamer勉強会 Security Onion編 激闘!Importノード
disconinja
1
370
こんなにあるの? 最近のIPAトレンドを ざっくりまとめてみた
watany
4
1k
QFHアンテナを作ってみた、 それとパッチアンテナ
takurx
1
150
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
Documentation Writing (for coders)
carmenintech
73
5k
A better future with KSS
kneath
239
17k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
The World Runs on Bad Software
bkeepers
PRO
70
11k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Facilitating Awesome Meetings
lara
55
6.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Transcript
@yot88 By yoan thirion S.O.L.I.D principles
@yot88 bad code / Good code Bad code vs Good
code Categorize each piece of code
None
@yot88 Singleton Tight Coupling Untestability Premature Optimization Indescriptive Naming Duplication
Single Responsibility Open/Closed Principle Liskov Substitution Interface Segregation Dependency Inversion Patterns and anti-patterns
@yot88 SRP A class should have only 1 responsibility
@yot88 Software entities should be open for extension, but closed
for modification. Open closed
@yot88 Subtypes must be substitutable for their base types. Liskov
substitution
@yot88 Clients should not be forced to depend on methods
that they do not use. Interface segregation
@yot88 High level modules should not depend on low level
modules : both should depend on abstractions. DI
@yot88 Good code / bad code Align each piece of
code with a S.O.L.I.D principle
1 3 3 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 13 16 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 4 2 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 15 14 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 8 6 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 11 9 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
3 10 5 1 3 16 13 2 4 14
15 6 8 9 12 5 10 11
12 1 3 16 13 2 4 14 15 6
8 9 12 5 10 11
1 3 16 13 2 4 14 15 6 8
9 12 5 10 11
@yot88 Let’s refactor using s.O.L.I.D
@yot88 exercises Practice S.O.L.I.D principles on code examples Clone the
repository at : https://github.com/ythirion/solid-kata Foreach code example : • identify why it’s breaking the given principle • Write down your refactoring strategy • Refactor it
@yot88 Where do you stand ? No quite yet On
the way Ready to roll