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.3k
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
84
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
45
Cultiver l'intelligence collective à l'heure de ChatGPT
thirion
0
67
Clean Code from the Cognition Point of View
thirion
2
96
Xanpan - une méthode agile hybride centrée sur l'équipe
thirion
0
110
Les aventures d'un facilitateur au pays des techs - Agile Grenoble 2023
thirion
0
92
Clean Code du point de vue de la cognition
thirion
1
190
Les aventures d'un facilitateur au pays des techs - Agile Tour Lausanne 2022
thirion
0
150
Functional Programming made easy in C#
thirion
0
210
Other Decks in How-to & DIY
See All in How-to & DIY
Using AWS to build a launchable knowledge rocket 👉 Organize knowledge, accelerate learning and understand AI in the process
dwchiang
0
130
ドラムスティックケースを生まれ変わらせて一歩踏み出した話
scbc1167
0
170
Invitation to Okinawa.rb in 2024
yasslab
PRO
1
690
地域JAWSの現状とベストプラクティス
awsjcpm
0
360
田中 is a new HelloWorld
akichika
1
250
Earthquake and Kominka
ramtop
0
140
[너구리랑! 회고 밋업 2023] 비전공자 PM의 우당탕탕 2023년 // 의현 님
develop_neoguri
0
100
音に負けない!子どもが騒いでいる脇でも快適オンラインMTGの秘伝
kaitou
0
300
GreenPAK 初心者向けハンズオン資料
aoisaya
2
110
苦いビールを避ける冴えたやり方
watany
2
150
在宅フルリモートワークを可能にするスキルと知識n連発! / how to more effective remoteworking
masaru_b_cl
3
830
ServiceNow Knowledgeの歩き方
manarobot
0
300
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
It's Worth the Effort
3n
183
27k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
The Language of Interfaces
destraynor
154
24k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
We Have a Design System, Now What?
morganepeng
50
7.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Why Our Code Smells
bkeepers
PRO
334
57k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Mobile First: as difficult as doing things right
swwweet
222
8.9k
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