-
Solid Principles Introduction
-
The SOLID principles are a set of design principles in object-oriented programming that help developers create more understandable, flexible and maintainable code, these help us solve most software design problems. These principles provide multiple ways to remove the tightly coupled code between the software components (between classes). There are 5 SOLID Principles to learn
Why there is need to know SOLID principles ?
As developers, we start developing applications using our experience and knowledge. But over time, the applications might cause bugs/issues, then we must alter the application design for every change request or new feature request. After some time, we might need to change the application design and logic for which we need deep understanding of previous logic and the business flow.
New change requests will keep on coming as requirements and also the new modules to be implemented and for that we have to make sure to implement the code base by following SOLID principles, as this makes our job easy for future updates.
Robert C. Martin came with these principles in the 1990s. These Five SOLID Principles provide us with ways to move from tightly coupled code and little encapsulation to the desired results of loosely coupled and encapsulated real business needs properly. SOLID is an acronym for the following.
- S: Single Responsibility Principle (SRP)
- O: Open-closed Principle (OCP)
- L: Liskov substitution Principle (LSP)
- I: Interface Segregation Principle (ISP)
- D: Dependency Inversion Principle (DIP)