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
140
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
95
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
150
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
230
Les aventures d'un facilitateur au pays des techs - Agile Tour Lausanne 2022
thirion
0
180
Functional Programming made easy in C#
thirion
0
260
Other Decks in How-to & DIY
See All in How-to & DIY
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
6
2.2k
ミシンと刺繍とOSS
godan
3
110
さらなるアウトプットに、Let's ライトニングトーク! ― LTのやり方
ma2shita
2
1.3k
Terra Charge|普通充電器ご利用ガイドブック / Terra Charge Ordinary Charger Guidebook
contents
1
300
ブロックテーマをゴリゴリに使い倒してサイトを作った話 / Kansai WordPress Meetup 2025 01 25
tbshiki
1
560
#スタックチャン「魔改造の夜」に行く
syumme01
1
270
AWSコミュニティプログラムのご紹介 -グローバル展開するコミュニティプログラム-
awsjcpm
0
170
#Stampfly #M5Stack 開発ストーリーと今後の可能性 前説
takasumasakazu
0
120
未来の投げ銭箱
inoue2002
2
120
ModuleLLM、最前線!
anoken
0
190
チームビルディングを受けてみた
harukahosokawa
3
180
GreenPAK 初心者向けハンズオン資料
aoisaya
2
460
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
6
300
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
5.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
A designer walks into a library…
pauljervisheath
207
24k
Unsuck your backbone
ammeep
671
58k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Docker and Python
trallard
44
3.5k
How GitHub (no longer) Works
holman
314
140k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
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