SlideShare a Scribd company logo
1 of 19
Download to read offline
Design principles
SRPSingle Responsibility Principle
A class should have one, and only one, reason to change.
OCPOpen-Closed Principle
You should be able to extend a classes behaviour, without modifying it.
LSPLiskov Substitution Principle
Derived classes must be substitutable for their base classes.
DIPDependency Inversion Principle
Depend on abstractions, not on concretions.
ISPInterface Segregation Principle
Make fine grained interfaces that are client specific.
REPRelease-Reuse Equivalency Principle
The granule of reuse is the granule of release.
CCPCommon Closure Principle
Classes that change together are packaged together.
CRPCommon Reuse Principle
Classes that are used together are packaged together.
ADPAcyclic Dependencies Principle
The dependency graph of packages must have no cycles.
SDPStable Dependencies Principle
Depend in the direction of stability.
SAPStable Abstractions Principle
Abstractness increases with stability.
Boy Scout Rule
Leave the code cleaner than you found it.
PoLAPrinciple of Least Astonishment
Related to the concept of developer habitability. If you (and the other fellow
developers of your team) are astonished by some specific solution, please discuss
this with the author (or follow the Boy Scout Rule).
Composition Instead of
Inheritance(Yo-Yo problem)
Inheritance implicates a problem towards testing. Only with sophisticated Build-In-
Tests (and unit tests) inheritance is good to handle.
Information Hiding
Principle Modularize
Around Secrets
Guidance for class design above basic data hiding. Relates also to hiding of
methods and especially algorithms building the value of that class.
SoCSeparation of Concerns
Group related stuff on every level of hierarchy: Method, Class, Package,
Component, Subsystem, ...
YAGNIYou ain't gonna need it
Another "meta-argument" besides the principle of least astonishment, which is
usable to argue against overcomplicated or too abstract/generic programming.
LoDLaw of Demeter
Good metric to follow, if it comes to "chain reactions" while modifying classes.

More Related Content

Similar to Design principles

Sec1_SOLID Principles_Software Engineering.pptx
Sec1_SOLID Principles_Software Engineering.pptxSec1_SOLID Principles_Software Engineering.pptx
Sec1_SOLID Principles_Software Engineering.pptxHebaSamy22
 
Solid as OOP abstraction
Solid as OOP abstractionSolid as OOP abstraction
Solid as OOP abstractionPawel Klimczyk
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design PrinciplesOcean Dong
 
Software design principles
Software design principlesSoftware design principles
Software design principlesMd.Mojibul Hoque
 
Pavlo Zhdanov "Mastering solid and base principles for software design"
Pavlo Zhdanov "Mastering solid and base principles for software design"Pavlo Zhdanov "Mastering solid and base principles for software design"
Pavlo Zhdanov "Mastering solid and base principles for software design"LogeekNightUkraine
 
Birth of a developer
Birth of a developerBirth of a developer
Birth of a developerPiyush Rahate
 
Design principles in the functional world
Design principles in the functional worldDesign principles in the functional world
Design principles in the functional worldDaniel Leon
 
Introduction to SOLID Principles
Introduction to SOLID PrinciplesIntroduction to SOLID Principles
Introduction to SOLID PrinciplesDave Cook
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of ControlShuhab Tariq
 
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
#4 | Object Oriented Programming's SOLID Principles | Sameer SiddiquiSameerAhmedSiddiqui1
 
Brief principle and principle of coding
Brief principle and principle of codingBrief principle and principle of coding
Brief principle and principle of codingJingchao Di
 
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 ArchitectsRicardo Wilkins
 
VADER 2011 (Younessi)
VADER 2011 (Younessi)VADER 2011 (Younessi)
VADER 2011 (Younessi)Carlos Cuesta
 

Similar to Design principles (20)

Sec1_SOLID Principles_Software Engineering.pptx
Sec1_SOLID Principles_Software Engineering.pptxSec1_SOLID Principles_Software Engineering.pptx
Sec1_SOLID Principles_Software Engineering.pptx
 
OO Design Principles
OO Design PrinciplesOO Design Principles
OO Design Principles
 
Solid as OOP abstraction
Solid as OOP abstractionSolid as OOP abstraction
Solid as OOP abstraction
 
Software Design Principles
Software Design PrinciplesSoftware Design Principles
Software Design Principles
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Pavlo Zhdanov "Mastering solid and base principles for software design"
Pavlo Zhdanov "Mastering solid and base principles for software design"Pavlo Zhdanov "Mastering solid and base principles for software design"
Pavlo Zhdanov "Mastering solid and base principles for software design"
 
SOLID Principles
SOLID PrinciplesSOLID Principles
SOLID Principles
 
Birth of a developer
Birth of a developerBirth of a developer
Birth of a developer
 
Solid Principles
Solid PrinciplesSolid Principles
Solid Principles
 
Design principles in the functional world
Design principles in the functional worldDesign principles in the functional world
Design principles in the functional world
 
Oop concepts
Oop conceptsOop concepts
Oop concepts
 
Oop principles
Oop principlesOop principles
Oop principles
 
Introduction to SOLID Principles
Introduction to SOLID PrinciplesIntroduction to SOLID Principles
Introduction to SOLID Principles
 
Inversion of Control
Inversion of ControlInversion of Control
Inversion of Control
 
SOLID design
SOLID designSOLID design
SOLID design
 
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
#4 | Object Oriented Programming's SOLID Principles | Sameer Siddiqui
 
Spring fundamentals
Spring fundamentalsSpring fundamentals
Spring fundamentals
 
Brief principle and principle of coding
Brief principle and principle of codingBrief principle and principle of coding
Brief principle and principle of coding
 
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
 
VADER 2011 (Younessi)
VADER 2011 (Younessi)VADER 2011 (Younessi)
VADER 2011 (Younessi)
 

More from Chinh Ngo Nguyen

Software architecture for developers
Software architecture for developersSoftware architecture for developers
Software architecture for developersChinh Ngo Nguyen
 
Case Study of Sound Cloud Architecture
Case Study of Sound Cloud ArchitectureCase Study of Sound Cloud Architecture
Case Study of Sound Cloud ArchitectureChinh Ngo Nguyen
 
Patterns of enterprise application architecture
Patterns of enterprise application architecturePatterns of enterprise application architecture
Patterns of enterprise application architectureChinh Ngo Nguyen
 

More from Chinh Ngo Nguyen (6)

Node js internal
Node js internalNode js internal
Node js internal
 
Software architecture for developers
Software architecture for developersSoftware architecture for developers
Software architecture for developers
 
Effective java
Effective javaEffective java
Effective java
 
Inside JVM
Inside JVMInside JVM
Inside JVM
 
Case Study of Sound Cloud Architecture
Case Study of Sound Cloud ArchitectureCase Study of Sound Cloud Architecture
Case Study of Sound Cloud Architecture
 
Patterns of enterprise application architecture
Patterns of enterprise application architecturePatterns of enterprise application architecture
Patterns of enterprise application architecture
 

Recently uploaded

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 

Recently uploaded (20)

Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 

Design principles