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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yoan
June 13, 2017
How-to & DIY
2.5k
2
Share
Write S.O.L.I.D code
Learn how to write Object Oriented S.O.L.I.D code
Yoan
June 13, 2017
More Decks by Yoan
See All by Yoan
Coder sans se noyer dans la complexité
thirion
0
100
L'artisanat logiciel à l'heure du numérique responsable
thirion
0
140
Clean Code du point de vue de la cognition
thirion
0
210
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
150
Cultiver l'intelligence collective à l'heure de ChatGPT
thirion
0
160
Clean Code from the Cognition Point of View
thirion
2
230
Xanpan - une méthode agile hybride centrée sur l'équipe
thirion
0
230
Les aventures d'un facilitateur au pays des techs - Agile Grenoble 2023
thirion
0
160
Clean Code du point de vue de la cognition
thirion
1
310
Other Decks in How-to & DIY
See All in How-to & DIY
JAWS-UG横浜100回記念 私のAWS ジャーニーと日本からみた横浜支部
awsjcpm
0
400
ATOMS3R-CAMとClaude SKILLSでタイムラプスチャレンジ #iotlt
n0bisuke2
0
290
餃子コミュニティの活性化/TechGYOZA
nishiuma
2
330
LLMはTRPGのGMができる(確信)
kgmkm
0
3k
MustをWillに変える技術 〜アイドル・郁田はるきが"すべき"の壁を超えるまで〜
subroh0508
1
1.9k
JAWS-UG 山梨 第10回 勉強会 Community Update
awsjcpm
0
1.1k
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
9
3.1k
「無理」を「コントロール」するスキル / Skills to Control "Muri"
hageyahhoo
6
4.1k
放っておくと怖い睡眠負債について/fjordbootcamp-251122
yuukago
3
280
令和なのでVoIP網に参加して電話サービスを作ってみた話
cibmc
0
130
Goカードゲームを 作ってみた!
senoue
0
250
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
460
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
550
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Writing Fast Ruby
sferik
630
63k
Paper Plane
katiecoart
PRO
1
51k
The Spectacular Lies of Maps
axbom
PRO
1
780
Practical Orchestrator
shlominoach
191
11k
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.2k
Embracing the Ebb and Flow
colly
88
5.1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
460
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