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)

Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Clean Architecture
Clean ArchitectureClean Architecture
Clean Architecture
 
Quick flask an intro to flask
Quick flask   an intro to flaskQuick flask   an intro to flask
Quick flask an intro to flask
 
Clean code: SOLID (iOS)
Clean code: SOLID (iOS)Clean code: SOLID (iOS)
Clean code: SOLID (iOS)
 
Clean architecture
Clean architectureClean architecture
Clean architecture
 
Deep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance PerformanceDeep Dive on Delivering Amazon EC2 Instance Performance
Deep Dive on Delivering Amazon EC2 Instance Performance
 
Sonatype nexus 로 docker registry 관리하기
Sonatype nexus 로 docker registry 관리하기Sonatype nexus 로 docker registry 관리하기
Sonatype nexus 로 docker registry 관리하기
 
Principios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLIDPrincipios de diseño de código orientado a objetos SOLID
Principios de diseño de código orientado a objetos SOLID
 
(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLI(DEV301) Automating AWS with the AWS CLI
(DEV301) Automating AWS with the AWS CLI
 
[2021] kotlin built-in higher-order functions
[2021] kotlin built-in higher-order functions[2021] kotlin built-in higher-order functions
[2021] kotlin built-in higher-order functions
 
git flow
git flowgit flow
git flow
 
Formation autour de git et git lab
Formation autour de git et git labFormation autour de git et git lab
Formation autour de git et git lab
 
Refactoring PHP
Refactoring PHPRefactoring PHP
Refactoring PHP
 
마이크로서비스 아키텍처로 개발하기
마이크로서비스 아키텍처로 개발하기마이크로서비스 아키텍처로 개발하기
마이크로서비스 아키텍처로 개발하기
 
VM example in mule
VM example in muleVM example in mule
VM example in mule
 
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments(DVO306) AWS CodeDeploy: Automating Your Software Deployments
(DVO306) AWS CodeDeploy: Automating Your Software Deployments
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Solid Prensipleri
Solid PrensipleriSolid Prensipleri
Solid Prensipleri
 
Clean Architecture Applications in Python
Clean Architecture Applications in PythonClean Architecture Applications in Python
Clean Architecture Applications in Python
 
Exciting New Alfresco REST APIs
Exciting New Alfresco REST APIsExciting New Alfresco REST APIs
Exciting New Alfresco REST APIs
 

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

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
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
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
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...
 

Python SOLID