SlideShare a Scribd company logo
SOLID Principles
Presented by Mónica Rodrigues
January 24rd, 2017
Contents ➢ What is SOLID
➢ Single responsibility Principle
➢ Open/Closed Principle
➢ Liskov Substitution Principle
➢ Interface Segregation Principle
➢ Dependency Inversion Principle
Who am I?
Mónica Rodrigues
Degree in Computer Science Engineer at ISEL
Software engineer since 2009
Keywords: Web Applications, ASP.NET MVC, ASP.NET Web API, REST,
Javascript, Angular, Best practices, Design patterns, SQL Server and
much more..
What is SOLID?
S
SRP
Single
Responsibility
Principle
O
OCP
Open/Closed
Principle
L
LSP
Liskovs
Substitution
Principle
I
ISP
Interface
Segregation
Principle
D
DIP
Dependency
Inversion
Principle
“A class should have one and
only one reason to change”
Single Responsibility Principle
Single Responsibility Principle
Business logic
Persistence
There are two
responsibilities
Single Responsibility Principle
How to solve this?
Single Responsibility Principle
Just create two different
classes
Open/Closed Principle
“Software entities should be
open for extension, but
closed for modification.”
Open/Closed Principle
Humm...and if I need to
add a new payment type?
You need to modificate
this class.
Open/Closed Principle
open for
extension
close for
modification
Liskov Substitution Principle
“Let q(x) be a property provable about
objects x of type T. Then q(y) should
be provable for objects y of type S
where S is a subtype of T”
What do you say?
Liskov Substitution Principle
“A subclass should behave in such a
way that it will not cause problems
when used instead of the
superclass.”
Liskov Substitution Principle
Liskov Substitution Principle
Much better
Interface Segregation Principle
“Clients should not be forced
to depend upon interfaces
that they don't use”
Interface Segregation Principle
Interface Segregation Principle
WHY?????
I don’t need you!!
Interface Segregation Principle
How to solve this?
Interface Segregation Principle
You need to create
two interfaces
Interface Segregation Principle
Dependency Inversion Principle
“High-level modules should not
depend on low-level modules. Both
should depend on abstractions.”
“Abstractions should not depend upon
details. Details should depend upon
abstractions.”
Dependency Inversion Principle
And if I need to send a
notification by SMS?
You need to change this.
Dependency Inversion Principle
So, I create an
interface and now?
Dependency Inversion Principle
Dependency Inversion Principle
Constructor injection:
Dependency Inversion Principle
Property injection:
Dependency Inversion Principle
Method injection:
Keep in mind
DRY - Don’t repeat yourself
+
SLAP - Single layer abstraction principle
+
SOLID
BEST DEVELOPER
Enjoy code and
Keep it simple!
Thank you

More Related Content

PPT
SOLID Design Principles
PPTX
Solid principles
KEY
Solid principles
PDF
Solid Principles
PPTX
Clean code: SOLID
PDF
software design principles
PPTX
Solid Principles
PPTX
SOLID principles
SOLID Design Principles
Solid principles
Solid principles
Solid Principles
Clean code: SOLID
software design principles
Solid Principles
SOLID principles

What's hot (20)

PDF
Introduction to SOLID Principles
PPTX
Design principles - SOLID
PDF
SOLID Design Principles applied in Java
PPTX
Learning solid principles using c#
PPTX
SOLID Principles
PPTX
Typescript ppt
KEY
SOLID Design Principles
PDF
Java 8 features
PPTX
Core java complete ppt(note)
PPTX
OOPS In JAVA.pptx
PDF
Spring Boot
PPTX
SOLID Principles
PDF
Clean Architecture
PPTX
Intro to React
PPTX
Introduction to microservices
PPTX
Introduction to Spring Framework
PDF
Spring Framework - AOP
PPT
Solid principles
PPTX
Sqlite
PPTX
Advance Java Topics (J2EE)
Introduction to SOLID Principles
Design principles - SOLID
SOLID Design Principles applied in Java
Learning solid principles using c#
SOLID Principles
Typescript ppt
SOLID Design Principles
Java 8 features
Core java complete ppt(note)
OOPS In JAVA.pptx
Spring Boot
SOLID Principles
Clean Architecture
Intro to React
Introduction to microservices
Introduction to Spring Framework
Spring Framework - AOP
Solid principles
Sqlite
Advance Java Topics (J2EE)
Ad

Similar to Solid principles (20)

PPT
SOLID principles-Present
PDF
Object Oriented Programming Ch3 SRP, DIP, ISP
PPTX
Solid Principles
PPTX
Apply SOLID Design principles to javascript code with immediate function invo...
PPTX
OO Design Principles
PPTX
Object Oriented Design SOLID Principles
PPTX
Software Design Principles (SOLID)
PPTX
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
PDF
Solid principles
PPTX
Solid design principles
PDF
Solid principle
PPTX
SOLID Principles in OOPS ooooooooo.pptx
PPTX
S.O.L.I.D. principles of software development
PPTX
Solid principles
PPTX
Birth of a developer
PDF
Android architecture
PPTX
PPTX
Design principle vs design patterns
PPTX
Solid
PPTX
Is your code solid
SOLID principles-Present
Object Oriented Programming Ch3 SRP, DIP, ISP
Solid Principles
Apply SOLID Design principles to javascript code with immediate function invo...
OO Design Principles
Object Oriented Design SOLID Principles
Software Design Principles (SOLID)
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
Solid principles
Solid design principles
Solid principle
SOLID Principles in OOPS ooooooooo.pptx
S.O.L.I.D. principles of software development
Solid principles
Birth of a developer
Android architecture
Design principle vs design patterns
Solid
Is your code solid
Ad

More from Monica Rodrigues (6)

PPTX
Iseltech17 - Single Page Applications
PPTX
Relax, it's spa time
PPTX
Como tudo começou
PPTX
The Power Of SPA - ISCTE
PPTX
The power of spa
PPTX
Modelos Mentais em 10 minutos
Iseltech17 - Single Page Applications
Relax, it's spa time
Como tudo começou
The Power Of SPA - ISCTE
The power of spa
Modelos Mentais em 10 minutos

Recently uploaded (20)

PPTX
additive manufacturing of ss316l using mig welding
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
Welding lecture in detail for understanding
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Lecture Notes Electrical Wiring System Components
PDF
PPT on Performance Review to get promotions
PDF
composite construction of structures.pdf
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Digital Logic Computer Design lecture notes
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
web development for engineering and engineering
PPTX
Sustainable Sites - Green Building Construction
additive manufacturing of ss316l using mig welding
Foundation to blockchain - A guide to Blockchain Tech
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
Welding lecture in detail for understanding
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Lecture Notes Electrical Wiring System Components
PPT on Performance Review to get promotions
composite construction of structures.pdf
Structs to JSON How Go Powers REST APIs.pdf
Digital Logic Computer Design lecture notes
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Strings in CPP - Strings in C++ are sequences of characters used to store and...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
web development for engineering and engineering
Sustainable Sites - Green Building Construction

Solid principles