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

SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
Samuel Breed
 

What's hot (20)

SOLID Design Principles applied in Java
SOLID Design Principles applied in JavaSOLID Design Principles applied in Java
SOLID Design Principles applied in Java
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Design patterns for microservice architecture
Design patterns for microservice architectureDesign patterns for microservice architecture
Design patterns for microservice architecture
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Monoliths and Microservices
Monoliths and Microservices Monoliths and Microservices
Monoliths and Microservices
 
Solid design principles
Solid design principlesSolid design principles
Solid design principles
 
Microservices
MicroservicesMicroservices
Microservices
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Introduction to Spring's Dependency Injection
Introduction to Spring's Dependency InjectionIntroduction to Spring's Dependency Injection
Introduction to Spring's Dependency Injection
 
Introduction to SOLID Principles
Introduction to SOLID PrinciplesIntroduction to SOLID Principles
Introduction to SOLID Principles
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
 
Real Life Clean Architecture
Real Life Clean ArchitectureReal Life Clean Architecture
Real Life Clean Architecture
 
Why Microservices
Why MicroservicesWhy Microservices
Why Microservices
 
Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...Developing applications with a microservice architecture (SVforum, microservi...
Developing applications with a microservice architecture (SVforum, microservi...
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Domain driven design
Domain driven designDomain driven design
Domain driven design
 

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

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

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...
 
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
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
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
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 

Python SOLID