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
M5Stickと超小型エッジAIカメラ「AITRIOS」
hoshinoresearch
0
480
JAWS-UG Fukuoka - AWS re:Invent 2024 re:Cap AWS Community Perspective
awsjcpm
2
160
CH32Vシリーズを楽しもう(74thの場合) / enjoy ch32v series
74th
1
950
習慣化のコツ
kiyomaru
1
110
AWSコミュニティプログラムとJAWS-UGアップデート / JAWS-UG函館 勉強会 vol.14
awsjcpm
2
130
M5Stackを使ってSズキの魔改造モンスターマシンを作ってみた
syumme01
0
170
JAWS-UG/AWSコミュニティ JAWS-UG おおいた
awsjcpm
2
2.8k
PlatformIO IDE用M5Stack定型コード環境の紹介
3110
1
550
Invitation to Okinawa.rb in 2024
yasslab
PRO
1
850
カンファレンスでリフレッシュ!無理なく楽しむカンファレンス参加術 / How to enjoy conferences without stress
kattsuuya
1
8.6k
未来大生の胃を支える函館グルメ
deflis
0
500
わたしと仕事とアジャイルコミュニティ / developers summit 2025
matsuoshi
0
1.1k
Featured
See All Featured
How to Ace a Technical Interview
jacobian
278
23k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Invisible Side of Design
smashingmag
301
51k
KATA
mclloyd
30
14k
Why Our Code Smells
bkeepers
PRO
336
57k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Building Applications with DynamoDB
mza
95
6.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
181
54k
Designing Experiences People Love
moore
142
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
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