SlideShare a Scribd company logo
SOLID DESIGN PRINCIPLES
SETS OF DESIGN PRINCIPLES IN OBJECT-ORIENTED SOFTWARE DEVELOPMENT
WHAT IS SOLID?
SOLID is one of the most popular sets of design principles in object-oriented software development. It’s a
mnemonic acronym for the following five design principles:
 Single Responsibility Principle
 Open/Closed Principle
 Liskov Substitution Principle
 Interface Segregation Principle
 Dependency Inversion
SINGLE RESPONSIBILITY PRINCIPLE
Robert C. Martin describes it as:
‘’A class should have one, and only one, reason to change.’’
Do you know Robert?
Robert C. Martin, colloquially known as "Uncle Bob", is an American software engineer and instructor. He is best known
for being one of the authors of the Agile Manifesto and for developing several software design principles.
Recommend to check his blog: http://blog.cleancoder.com/
SINGLE RESPONSIBILITY PRINCIPLE
Why should you use it and what happens if you ignore it?
 Frequency and effects of changes
 Easier to understand
SINGLE RESPONSIBILITY PRINCIPLE
A simple question to validate your design
‘’What is the responsibility of your class/component/microservice?’’
Here is an example
OPEN/CLOSED PRINCIPLE
“Software entities (classes, modules, functions, etc.) should be open for extension, but closed for
modification.”
OPEN/CLOSED PRINCIPLE
It tells you to write your code so that you will be able to add new functionality without changing the
existing code. That prevents situations in which a change to one of your classes also requires you to adapt
all depending classes.
Here is an exmple.
LISKOV SUBSTITUTION PRINCIPLE
Child classes should never break the parent class' type definitions.
Or
Subtypes must be substitutable for their base types.
INTERFACE SEGREGATION PRINCIPLE
“Clients should not be forced to depend upon interfaces that they do not use.”
DEPENDENCY INVERSION PRINCIPLE
1. High-level modules should not depend on low-level modules. Both should
depend on abstractions.
2. Abstractions should not depend on details. Details should depend on
abstractions.
THANKS FOR YOUR ATTENTION
MAHMOUD ASADI . ASADI.PUB@GMAIL.COM

More Related Content

What's hot

Solid principles
Solid principlesSolid principles
Solid principles
Monica Rodrigues
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
Samuel Breed
 
Solid principles
Solid principlesSolid principles
Solid principles
Declan Whelan
 
Open Close Principle
Open Close PrincipleOpen Close Principle
Open Close Principle
Thaichor Seng
 
SOLID
SOLIDSOLID
Introduction to SOLID Principles
Introduction to SOLID PrinciplesIntroduction to SOLID Principles
Introduction to SOLID Principles
Ganesh Samarthyam
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
humayunlkhan
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
Surendra Shukla
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
rainynovember12
 
The Single Responsibility Principle
The Single Responsibility PrincipleThe Single Responsibility Principle
The Single Responsibility Principle
Lars-Erik Kindblad
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class design
Neetu Mishra
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
SamuelAnsong6
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
Aditya Kumar Rajan
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
Paul Blundell
 
SOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principlesSOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principles
Sergey Karpushin
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
Thiago Dos Santos Hora
 
Refactoring
RefactoringRefactoring
Refactoring
Ricardo Terra
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
Marco Mangia Musardo
 
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
Ricardo Wilkins
 
Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)
Prashanth Kumar
 

What's hot (20)

Solid principles
Solid principlesSolid principles
Solid principles
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Solid principles
Solid principlesSolid principles
Solid principles
 
Open Close Principle
Open Close PrincipleOpen Close Principle
Open Close Principle
 
SOLID
SOLIDSOLID
SOLID
 
Introduction to SOLID Principles
Introduction to SOLID PrinciplesIntroduction to SOLID Principles
Introduction to SOLID Principles
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
 
The Single Responsibility Principle
The Single Responsibility PrincipleThe Single Responsibility Principle
The Single Responsibility Principle
 
principles of object oriented class design
principles of object oriented class designprinciples of object oriented class design
principles of object oriented class design
 
Object Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) IntroductionObject Oriented Programming (OOP) Introduction
Object Oriented Programming (OOP) Introduction
 
Learning solid principles using c#
Learning solid principles using c#Learning solid principles using c#
Learning solid principles using c#
 
Open Closed Principle kata
Open Closed Principle kataOpen Closed Principle kata
Open Closed Principle kata
 
SOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principlesSOLID, DRY, SLAP design principles
SOLID, DRY, SLAP design principles
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Refactoring
RefactoringRefactoring
Refactoring
 
Dependency Inversion Principle
Dependency Inversion PrincipleDependency Inversion Principle
Dependency Inversion Principle
 
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
 
Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)Memory Management in the Java Virtual Machine(Garbage collection)
Memory Management in the Java Virtual Machine(Garbage collection)
 

Similar to Solid design principles

Solid principle
Solid principleSolid principle
Solid principle
muhammadali0014
 
Solid
SolidSolid
Android architecture
Android architectureAndroid architecture
Android architecture
Vandana Srivastava
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
Juan Lopez
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#
Ken Burkhardt
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In College
Jacinto Limjap
 
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile development
Simon Gould
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
Basavaraj Patil
 
S.O.L.I.D. principles of software development
S.O.L.I.D. principles of software developmentS.O.L.I.D. principles of software development
S.O.L.I.D. principles of software development
AmanSoni129
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User Group
Adnan Masood
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.
ONE BCG
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
Knoldus Inc.
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
debasish duarah
 
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLIDCodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
Codecamp Romania
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
Steve Zhang
 
Solid
SolidSolid
Design principle vs design patterns
Design principle vs design patternsDesign principle vs design patterns
Design principle vs design patterns
Prabhakar Sharma
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-Present
Quang Nguyen
 
Solid principles
Solid principlesSolid principles
Solid principles
Kumaresh Chandra Baruri
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
Anju Kanjirathingal
 

Similar to Solid design principles (20)

Solid principle
Solid principleSolid principle
Solid principle
 
Solid
SolidSolid
Solid
 
Android architecture
Android architectureAndroid architecture
Android architecture
 
Dependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and PatternsDependency Injection, Design Principles and Patterns
Dependency Injection, Design Principles and Patterns
 
SOLID Software Principles with C#
SOLID Software Principles with C#SOLID Software Principles with C#
SOLID Software Principles with C#
 
Three Developer Abilities They Dont Teach In College
Three Developer  Abilities They Dont Teach In CollegeThree Developer  Abilities They Dont Teach In College
Three Developer Abilities They Dont Teach In College
 
Solid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile developmentSolid OO & Clean Coding is essential to successful Agile development
Solid OO & Clean Coding is essential to successful Agile development
 
DesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatternsDesignPrinciples-and-DesignPatterns
DesignPrinciples-and-DesignPatterns
 
S.O.L.I.D. principles of software development
S.O.L.I.D. principles of software developmentS.O.L.I.D. principles of software development
S.O.L.I.D. principles of software development
 
SOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User GroupSOLID Principles of Refactoring Presentation - Inland Empire User Group
SOLID Principles of Refactoring Presentation - Inland Empire User Group
 
An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.An ultimate guide to SOLID Principles, developers must know.
An ultimate guide to SOLID Principles, developers must know.
 
SOLID Design Principles for Test Automaion
SOLID Design Principles for Test AutomaionSOLID Design Principles for Test Automaion
SOLID Design Principles for Test Automaion
 
android principle.pptx
android principle.pptxandroid principle.pptx
android principle.pptx
 
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLIDCodeCamp Iasi 10 march 2012 - Scratching-SOLID
CodeCamp Iasi 10 march 2012 - Scratching-SOLID
 
The OO Design Principles
The OO Design PrinciplesThe OO Design Principles
The OO Design Principles
 
Solid
SolidSolid
Solid
 
Design principle vs design patterns
Design principle vs design patternsDesign principle vs design patterns
Design principle vs design patterns
 
SOLID principles-Present
SOLID principles-PresentSOLID principles-Present
SOLID principles-Present
 
Solid principles
Solid principlesSolid principles
Solid principles
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 

Recently uploaded

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Undress Baby
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 

Recently uploaded (20)

Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdfRevolutionizing Visual Effects Mastering AI Face Swaps.pdf
Revolutionizing Visual Effects Mastering AI Face Swaps.pdf
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 

Solid design principles

  • 1. SOLID DESIGN PRINCIPLES SETS OF DESIGN PRINCIPLES IN OBJECT-ORIENTED SOFTWARE DEVELOPMENT
  • 2. WHAT IS SOLID? SOLID is one of the most popular sets of design principles in object-oriented software development. It’s a mnemonic acronym for the following five design principles:  Single Responsibility Principle  Open/Closed Principle  Liskov Substitution Principle  Interface Segregation Principle  Dependency Inversion
  • 3. SINGLE RESPONSIBILITY PRINCIPLE Robert C. Martin describes it as: ‘’A class should have one, and only one, reason to change.’’ Do you know Robert? Robert C. Martin, colloquially known as "Uncle Bob", is an American software engineer and instructor. He is best known for being one of the authors of the Agile Manifesto and for developing several software design principles. Recommend to check his blog: http://blog.cleancoder.com/
  • 4. SINGLE RESPONSIBILITY PRINCIPLE Why should you use it and what happens if you ignore it?  Frequency and effects of changes  Easier to understand
  • 5. SINGLE RESPONSIBILITY PRINCIPLE A simple question to validate your design ‘’What is the responsibility of your class/component/microservice?’’ Here is an example
  • 6. OPEN/CLOSED PRINCIPLE “Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.”
  • 7. OPEN/CLOSED PRINCIPLE It tells you to write your code so that you will be able to add new functionality without changing the existing code. That prevents situations in which a change to one of your classes also requires you to adapt all depending classes. Here is an exmple.
  • 8. LISKOV SUBSTITUTION PRINCIPLE Child classes should never break the parent class' type definitions. Or Subtypes must be substitutable for their base types.
  • 9. INTERFACE SEGREGATION PRINCIPLE “Clients should not be forced to depend upon interfaces that they do not use.”
  • 10. DEPENDENCY INVERSION PRINCIPLE 1. High-level modules should not depend on low-level modules. Both should depend on abstractions. 2. Abstractions should not depend on details. Details should depend on abstractions.
  • 11. THANKS FOR YOUR ATTENTION MAHMOUD ASADI . ASADI.PUB@GMAIL.COM