SOLID Principles
Presented by,
Aayushi Shah
Janvi Shah
Kaushik Sathvara
Anil Soni
https://htree.plus/
Introduction
Philosophy
Don’t repeat yourself
Keep it simple and stupid
You aren’t gonna need it
https://htree.plus/
Single Responsibility
Do you expect, your ide will code for you?
https://htree.plus/
Open-Closed
Operating System
https://htree.plus/
What is Liskov substitution principle?
Child classes should not break the parent
class's type definitions.
Liskov SubstitutionPrinciple
https://htree.plus/
What is breaking the rule of Liskov principle?
In below class diagram we cannot withdraw from kids account and that will create an exception in
superclass withdrawal method. That is a breach in Liskov Substitution Principle.
❌ Withdraw method in the kids account class is a breach
of LSP
✔️ Handling Non withdrawable behaviour by introducing two
new classes inheriting base class.
https://htree.plus/
Interface-segregation principle (ISP) states that :
“Client should not be forced to depend on methods it does not use.”
Why ISP is needed?
● Fat Interface
Interface Segregation Principle
https://htree.plus/
What ISP suggests?
● Role Interfaces
Advantages :
● Small, highly cohesive and
“Solid” classes
● increases readability and maintainability
https://htree.plus/
Dependency Inversion Principle
Dependency Inversion Principle states that:
“Entities must depend on abstractions not on concretions”
What does it says?
● High level modules
● Low level modules
https://htree.plus/
Example:
https://htree.plus/
Conclusion:
By applying these 5 principles that make the SOLID acronym, we get to benefit from a
reusable, maintainable, scalable and easy testable codebase.
https://htree.plus/
References
● https://scotch.io/bar-talk/s-o-l-i-d-the-first-five-principles-of-object-oriented-design
● https://medium.com/@trekhleb/solid-principles-around-you-6db2f0e12139
● https://fi.ort.edu.uy/innovaportal/file/2032/1/design_principles.pdf(4-16)
● https://blog.bitsrc.io/solid-principles-every-developer-should-know-b3bfa96bb688
● https://itnext.io/solid-principles-explanation-and-examples-715b975dcad4
● https://docs.google.com/a/cleancoder.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BwhCYaYDn8E
gOTViYjJhYzMtMzYxMC00MzFjLWJjMzYtOGJiMDc5N2JkYmJi&hl=en
● https://www.baeldung.com/solid-principles
● https://hackernoon.com/solid-principles-simple-and-easy-explanation-f57d86c47a7f
https://htree.plus/
THANK YOU
https://htree.plus/

SOLID Principles