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
100
Agile Tech Coaching - The Missing Piece Of Your Organization
thirion
1
75
Cultiver l'intelligence collective à l'heure de ChatGPT
thirion
0
89
Clean Code from the Cognition Point of View
thirion
2
130
Xanpan - une méthode agile hybride centrée sur l'équipe
thirion
0
120
Les aventures d'un facilitateur au pays des techs - Agile Grenoble 2023
thirion
0
100
Clean Code du point de vue de la cognition
thirion
1
210
Les aventures d'un facilitateur au pays des techs - Agile Tour Lausanne 2022
thirion
0
160
Functional Programming made easy in C#
thirion
0
230
Other Decks in How-to & DIY
See All in How-to & DIY
Learning from Firefighters
ksatirli
PRO
0
160
240420MapillaryMeetup2024Tokyo
tosseto
0
200
LT(Lightning Talk)のドキドキ感を共有する IoT ぼっとを作った話
scbc1167
1
170
[너구리랑! 회고 밋업 2023] GTD & PARA -머릿속이 복잡하던 일상에 적용한 정리법 // 토르 님
develop_neoguri
1
460
Notionでの快適メモ術
ayumu11
0
1.1k
JAWS Days 2024 Keynote by Jeff Barr
awsjcpm
0
170
生成AIとミニ四駆で学ぶ! MATLAB/Simulink
covao
1
220
PlatformIO IDE用M5Stack定型コード環境の紹介
3110
1
420
バーチャルバナナとリアルバナナ #iotlt #TouchDesigner
n0bisuke2
0
120
[너구리랑! 회고 밋업 2023] 하루만에 만든 프로젝트에서 고객이 매월 결제하는 제품을 만들기까지의 여정 // 초링 님
develop_neoguri
1
100
スカウト返信率を倍にするためにやったこと / 2024-01-29
tamago3keran
3
1k
「RubyでLチカ」に挑戦してみた
isaka1022
0
160
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
427
64k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Typedesign – Prime Four
hannesfritz
40
2.5k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
What's in a price? How to price your products and services
michaelherold
244
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
33
2.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
KATA
mclloyd
29
14k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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