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
S.O.L.I.D. Python
Search
Eduardo Ferro Aldama
November 24, 2013
Technology
0
180
S.O.L.I.D. Python
Presentación PyConES 2013 Madrid 24/11/2013 clean code,pycones,python,solid
Eduardo Ferro Aldama
November 24, 2013
Tweet
Share
More Decks by Eduardo Ferro Aldama
See All by Eduardo Ferro Aldama
Golang design4concurrency
eferro
0
75
Python Herencia vs Composición (Luke soy tu padre)
eferro
0
190
Tdd/bdd prácticoaplicaciones con dominio rico
eferro
0
79
Mejor Framework PythonOO+SOLID. Vivir sin Frameworks
eferro
0
65
Other Decks in Technology
See All in Technology
JSConf JPのwebsiteをGatsbyからNext.jsに移行した話 - Next.jsの多言語静的サイトと課題
leko
2
180
Data Hubグループ 紹介資料
sansan33
PRO
0
2.2k
コンパウンド組織のCRE #cre_meetup
layerx
PRO
1
240
ストレージエンジニアの仕事と、近年の計算機について / 第58回 情報科学若手の会
pfn
PRO
2
270
AWS DMS で SQL Server を移行してみた/aws-dms-sql-server-migration
emiki
0
150
ソースを読むプロセスの例
sat
PRO
15
9.9k
Digitization部 紹介資料
sansan33
PRO
1
5.7k
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3k
混合雲環境整合異質工作流程工具運行關鍵業務 Job 的經驗分享
yaosiang
0
170
[2025年10月版] Databricks Data + AI Boot Camp
databricksjapan
1
250
[VPoE Global Summit] サービスレベル目標による信頼性への投資最適化
satos
0
230
AIプロダクトのプロンプト実践テクニック / Practical Techniques for AI Product Prompts
saka2jp
0
100
Featured
See All Featured
Six Lessons from altMBA
skipperchong
29
4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
930
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
GitHub's CSS Performance
jonrohan
1032
470k
Typedesign – Prime Four
hannesfritz
42
2.8k
Keith and Marios Guide to Fast Websites
keithpitt
411
23k
Facilitating Awesome Meetings
lara
57
6.6k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Git: the NoSQL Database
bkeepers
PRO
431
66k
How to Ace a Technical Interview
jacobian
280
24k
Product Roadmaps are Hard
iamctodd
PRO
55
11k
For a Future-Friendly Web
brad_frost
180
10k
Transcript
S.O.L.I.D. Python
Alea Soluciones Bifer Team
@eferro @pasku1 @apa42 @nestorsalceda
Usual OO Systems Rigid Fragile Immobile Viscous
None
Why S.O.L.I.D. principles? To create easy to maintain OO systems
Improve reusability Easy testing
For creating Clean Code
It's all about money
None
S.O.L.I.D SRP - Single responsibility principle DIP - Dependency inversion
principle OCP - Open/closed principle LSP - Liskov substitution principle ISP - Interface segregation principle
Principles Not Rules
None
Car wash service car wash job when the car enters
in the car wash ✓ it registers a job customer notification when service completed ✓ it notifies the customer reporting when client report requested ✓ it shows all wash services for that customer 3 examples ran in 0.0178 seconds
None
None
None
None
… Some refactors / versions later
None
None
Depend upon Abstractions. Do not depend upon concretion
Compilation / Startup time dependency from <package> import module
Runtime dependency self.collaborator.message()
None
Global State Problem Implicit dependency problem Concrete API
No dependency injection Implicit dependency problem Concrete API
None
None
None
None
None
None
Duck Typing Approved!!!
None
Liskov Substitution principle violation
Python don't force type inheritance For API implementation (So, for
reuse code, prefer Composition)
Derived types must be completely substitutable for their base types
None
It isn't so important
A narrow interface is a better interface
SOLID Motivational Posters, by Derick Bailey http://lostechies.com/derickbailey/2009/02/11/solid-development-principles-in-motivational-pictures/
car_wash code example https://github.com/aleasoluciones/car_wash SOLID definition (at wikipedia) http://en.wikipedia.org/wiki/SOLID_(object-oriented_design) Getting
a SOLID start (Uncle Bob) http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod Video SOLID Object Oriented Design (Sandi Metz) http://www.confreaks.com/videos/240-goruco2009-solid-object-oriented-design
None
None
Thanks !!! @eferro @pasku1 @apa42 @nestorsalceda