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
99
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
250
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
AWS Summit Japan 2025 個人的参加レポート
midnight480
0
150
AWS User Community - JAWS-UG/AWS ユーザーコミュニティのご紹介
awsjcpm
1
220
AWSと学生支援 - Education-JAWS #0
awsjcpm
1
170
新婚19年目から学ぶ夫婦円満の正しい歩き方 / Life is beautiful
soudai
PRO
12
4.7k
中指立てたか判定IoT #iotlt #p5js
n0bisuke2
0
310
いぬぬウォッチャー - オレトク賞オンライン決勝 #ヒーローズリーグ
n0bisuke2
0
230
The Definitive? Guide To Locally Organizing RubyKaigi
sylph01
6
1.6k
こんなにあるの? 最近のIPAトレンドを ざっくりまとめてみた
watany
4
1k
Why did my proposals get rejected?
okuramasafumi
1
730
CH32Vシリーズを楽しもう(74thの場合) / enjoy ch32v series
74th
1
1.1k
파이썬 토룡신점 운영후기
lqez
0
460
JAWS-UGとAWS - JAWS-UG彩の国埼玉設立のお祝い
awsjcpm
2
530
Featured
See All Featured
Speed Design
sergeychernyshev
32
1.1k
GraphQLとの向き合い方2022年版
quramy
49
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Why Our Code Smells
bkeepers
PRO
339
57k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
The Cult of Friendly URLs
andyhume
79
6.6k
How GitHub (no longer) Works
holman
315
140k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Intergalactic Javascript Robots from Outer Space
tanoku
272
27k
Gamification - CAS2011
davidbonilla
81
5.4k
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