SlideShare a Scribd company logo
1 of 45
Download to read offline
S.O.L.I.D. Python
Alea Soluciones
Bifer Team
@eferro
@pasku1
@apa42
@nestorsalceda
Usual OO Systems
Rigid
Fragile
Immobile
Viscous
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
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
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
…
Some refactors / versions later
Depend upon Abstractions. Do not depend upon concretion
Compilation / Startup time
dependency
from <package> import module
Runtime dependency

self.collaborator.message()
Global State Problem
Implicit dependency problem
Concrete API
No dependency injection
Implicit dependency problem

Concrete API
Duck Typing Approved!!!
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
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
Thanks !!!
@eferro
@pasku1
@apa42
@nestorsalceda

More Related Content

What's hot

What's hot (20)

Solid principles
Solid principlesSolid principles
Solid principles
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Single Responsibility Principle
Single Responsibility PrincipleSingle Responsibility Principle
Single Responsibility Principle
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
The Single Responsibility Principle
The Single Responsibility PrincipleThe Single Responsibility Principle
The Single Responsibility Principle
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Solid Principle
Solid PrincipleSolid Principle
Solid Principle
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Liscov substitution principle
Liscov substitution principleLiscov substitution principle
Liscov substitution principle
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Clean code: SOLID
Clean code: SOLIDClean code: SOLID
Clean code: SOLID
 
S.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software ArchitectsS.O.L.I.D. Principles for Software Architects
S.O.L.I.D. Principles for Software Architects
 
CQRS and Event Sourcing
CQRS and Event Sourcing CQRS and Event Sourcing
CQRS and Event Sourcing
 
Solid design principles
Solid design principlesSolid design principles
Solid design principles
 
Git
GitGit
Git
 
Design principle vs design patterns
Design principle vs design patternsDesign principle vs design patterns
Design principle vs design patterns
 
Design principles - SOLID
Design principles - SOLIDDesign principles - SOLID
Design principles - SOLID
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
 
SOLID PRINCIPLES
SOLID PRINCIPLESSOLID PRINCIPLES
SOLID PRINCIPLES
 
SOLID
SOLIDSOLID
SOLID
 

Similar to Python SOLID

Spring framework & inversion of control
Spring framework & inversion of controlSpring framework & inversion of control
Spring framework & inversion of control
Nazim Sitmanbetov
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design Principles
Ocean Dong
 

Similar to Python SOLID (20)

SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Is your code solid
Is your code solidIs your code solid
Is your code solid
 
Improving The Quality of Existing Software
Improving The Quality of Existing SoftwareImproving The Quality of Existing Software
Improving The Quality of Existing Software
 
Agile integration: Decomposing the monolith
Agile integration: Decomposing the monolithAgile integration: Decomposing the monolith
Agile integration: Decomposing the monolith
 
Microservices, Data Services and Containers for Cloud Native Architectures (D...
Microservices, Data Services and Containers for Cloud Native Architectures (D...Microservices, Data Services and Containers for Cloud Native Architectures (D...
Microservices, Data Services and Containers for Cloud Native Architectures (D...
 
Spring framework & inversion of control
Spring framework & inversion of controlSpring framework & inversion of control
Spring framework & inversion of control
 
Object Oriented Concepts and Principles
Object Oriented Concepts and PrinciplesObject Oriented Concepts and Principles
Object Oriented Concepts and Principles
 
Solid principle
Solid principleSolid principle
Solid principle
 
Introduction to OSLC and Linked Data
Introduction to OSLC and Linked DataIntroduction to OSLC and Linked Data
Introduction to OSLC and Linked Data
 
Solid
SolidSolid
Solid
 
SOLID and Clean Code with life project example
SOLID and Clean Code with life project exampleSOLID and Clean Code with life project example
SOLID and Clean Code with life project example
 
Accelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and MicroservicesAccelerate your Application Delivery with DevOps and Microservices
Accelerate your Application Delivery with DevOps and Microservices
 
(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?(java2days) Is the Future of Java Cloudy?
(java2days) Is the Future of Java Cloudy?
 
Spring 1 day program
Spring 1 day programSpring 1 day program
Spring 1 day program
 
Improving the Design of Existing Software
Improving the Design of Existing SoftwareImproving the Design of Existing Software
Improving the Design of Existing Software
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design Principles
 
Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)Design for testability as a way to good coding (SOLID and IoC)
Design for testability as a way to good coding (SOLID and IoC)
 
Improving the Quality of Existing Software
Improving the Quality of Existing SoftwareImproving the Quality of Existing Software
Improving the Quality of Existing Software
 
Take Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL CompilerTake Full Advantage of the Oracle PL/SQL Compiler
Take Full Advantage of the Oracle PL/SQL Compiler
 

More from Eduardo Ferro Aldama

CAS2016 El Arte del patadon pa'lante / Posponer decisiones
CAS2016 El Arte del patadon pa'lante / Posponer decisionesCAS2016 El Arte del patadon pa'lante / Posponer decisiones
CAS2016 El Arte del patadon pa'lante / Posponer decisiones
Eduardo Ferro Aldama
 

More from Eduardo Ferro Aldama (19)

Product discovery engineering point of view
Product discovery   engineering point of viewProduct discovery   engineering point of view
Product discovery engineering point of view
 
Scalability, basics, application to systems, teams and processes
Scalability, basics, application to systems, teams and processesScalability, basics, application to systems, teams and processes
Scalability, basics, application to systems, teams and processes
 
Agile, en que te hemos convertido v2
Agile, en que te hemos convertido v2Agile, en que te hemos convertido v2
Agile, en que te hemos convertido v2
 
Entrega continua tomandonos la agilidad en serio
Entrega continua   tomandonos la agilidad en serioEntrega continua   tomandonos la agilidad en serio
Entrega continua tomandonos la agilidad en serio
 
Madrid devops forward devops is not what you think
Madrid devops forward devops is not what you thinkMadrid devops forward devops is not what you think
Madrid devops forward devops is not what you think
 
Bilbostack19 devops is not what you think
Bilbostack19 devops is not what you thinkBilbostack19 devops is not what you think
Bilbostack19 devops is not what you think
 
Continuous delivery practices and real experiences
Continuous delivery   practices and real experiencesContinuous delivery   practices and real experiences
Continuous delivery practices and real experiences
 
Cas18 sobreviviendo en producción / Gestión de Incidencias y aprendizajes
Cas18 sobreviviendo en producción / Gestión de Incidencias y aprendizajesCas18 sobreviviendo en producción / Gestión de Incidencias y aprendizajes
Cas18 sobreviviendo en producción / Gestión de Incidencias y aprendizajes
 
CODE ContinuousDelivery. germinando una cultura agile moderna
CODE  ContinuousDelivery. germinando una cultura agile modernaCODE  ContinuousDelivery. germinando una cultura agile moderna
CODE ContinuousDelivery. germinando una cultura agile moderna
 
CAS2017 Agilidad. Hacia la entrega continua ¿Qué te lo impide?
CAS2017 Agilidad. Hacia la entrega continua ¿Qué te lo impide?CAS2017 Agilidad. Hacia la entrega continua ¿Qué te lo impide?
CAS2017 Agilidad. Hacia la entrega continua ¿Qué te lo impide?
 
Acelerando la cultura DevOps mediante Entrega Continua
Acelerando la cultura DevOps mediante Entrega ContinuaAcelerando la cultura DevOps mediante Entrega Continua
Acelerando la cultura DevOps mediante Entrega Continua
 
SCPNA2017 El arte del patadon pa'lante / libro de recetas
SCPNA2017 El arte del patadon pa'lante / libro de recetasSCPNA2017 El arte del patadon pa'lante / libro de recetas
SCPNA2017 El arte del patadon pa'lante / libro de recetas
 
CAS2016 El Arte del patadon pa'lante / Posponer decisiones
CAS2016 El Arte del patadon pa'lante / Posponer decisionesCAS2016 El Arte del patadon pa'lante / Posponer decisiones
CAS2016 El Arte del patadon pa'lante / Posponer decisiones
 
Golang design4concurrency
Golang design4concurrencyGolang design4concurrency
Golang design4concurrency
 
Python Herencia vs Composición (Luke soy tu padre)
Python Herencia vs Composición (Luke soy tu padre)Python Herencia vs Composición (Luke soy tu padre)
Python Herencia vs Composición (Luke soy tu padre)
 
Tdd bdd-practico-dominio-rico
Tdd bdd-practico-dominio-ricoTdd bdd-practico-dominio-rico
Tdd bdd-practico-dominio-rico
 
Mejor framework-pythonoo-solid
Mejor framework-pythonoo-solidMejor framework-pythonoo-solid
Mejor framework-pythonoo-solid
 
Python Madrid empaquetamiento deb aplicaciones Python
Python Madrid empaquetamiento deb aplicaciones PythonPython Madrid empaquetamiento deb aplicaciones Python
Python Madrid empaquetamiento deb aplicaciones Python
 
Madrid devops empaquetamientodeb_i
Madrid devops empaquetamientodeb_iMadrid devops empaquetamientodeb_i
Madrid devops empaquetamientodeb_i
 

Recently uploaded

Recently uploaded (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Python SOLID