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
2.5k
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
L'artisanat logiciel à l'heure du numérique responsable
thirion
0
91
Clean Code du point de vue de la cognition
thirion
0
180
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
130
Cultiver l'intelligence collective à l'heure de ChatGPT
thirion
0
130
Clean Code from the Cognition Point of View
thirion
2
190
Xanpan - une méthode agile hybride centrée sur l'équipe
thirion
0
200
Les aventures d'un facilitateur au pays des techs - Agile Grenoble 2023
thirion
0
140
Clean Code du point de vue de la cognition
thirion
1
270
Les aventures d'un facilitateur au pays des techs - Agile Tour Lausanne 2022
thirion
0
200
Other Decks in How-to & DIY
See All in How-to & DIY
終わりのない会議を超えて:HolacracyのTactical Meetingを体験しよう!
andrearc
0
170
20250226_AI Code Agents祭り_MK_AIコーディングエージェントのコラボレーション開発
mk0721
PRO
0
130
スイングやカードをいい感じに立てるスタンドの話
niccolli
1
400
Azure PortalのQoLを上げてたら Big Techに怒られた
horihiro
2
540
ATOMS3R-CAMとClaude SKILLSでタイムラプスチャレンジ #iotlt
n0bisuke2
0
230
ボードゲーム × 専用収納 〜3Dプリントで埋めるニッチな隙間〜 / Board Games × Custom Storage
handlename
0
180
ラズパイカメラ向け ケーブル延長基板・ハウジングの開発
koheimasaki
PRO
2
440
JAWS-UG/AWSコミュニティ -JAWS-UGくまもと#16
awsjcpm
1
180
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
9
2.5k
Goカードゲームを 作ってみた!
senoue
0
180
キャリア科目では教えてくれない、就活を生き抜く法則
logica0419
1
210
JAWS-UG/AWSコミュニティ JAWS-UG おおいた
awsjcpm
2
2.9k
Featured
See All Featured
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
200
Evolving SEO for Evolving Search Engines
ryanjones
0
120
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
For a Future-Friendly Web
brad_frost
182
10k
Designing for humans not robots
tammielis
254
26k
The Pragmatic Product Professional
lauravandoore
37
7.1k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
180
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Practical Orchestrator
shlominoach
191
11k
How GitHub (no longer) Works
holman
316
140k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
60
42k
Building AI with AI
inesmontani
PRO
1
690
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