S.O.L.I.D (This is an acronym introduced by Michael Feathers)
- Single Responsibility Principle (SRP)
- Open/Closed Principle (OCP)
- Liskov Substitution Principle (LSP)
- Interface Segregation Principle (ISP)
- Dependency Inversion Principle (DIP)
Some Facts
OOP is a programming paradigm based on concepts of object whereas S.O.L.I.D. are the programing principles that tell us how to write good programs.
Design patterns are telling how to design our programs/software but on the other hand S.O.L.I.D are only principles to make our program clean.
Single Responsibility Principle (SRP)
A class should be designed for single responsibility and there should not be more than one reason to make changes to this class. The responsibility of this class should be completely tied/encapsulated by the class.
No comments:
Post a Comment