| SOLID |
|---|
| Principles |
In object-oriented programming and functional programming, SOLID is a mnemonic acronym for five principles intended to make source code more understandable, flexible, and maintainable. Although the principles apply to object-oriented programming, they also form a core philosophy for methodologies such as agile software development and adaptive software development.
Software engineer and instructor Robert C. Martin introduced the basic principles of SOLID design in his 2000 paper Design Principles and Design Patterns about software rot.: 2–3 The SOLID acronym was coined around 2004 by Michael Feathers.
The single-responsibility principle (SRP) states that there should never be more than one reason for a class to change. In other words, every class should have only one responsibility.
Importance:
The open–closed principle (OCP) states that software entities should be open for extension, but closed for modification.
Importance:
The Liskov substitution principle (LSP) states that functions that use pointers or references to base classes must be able to use pointers or references of derived classes without knowing it.
Importance:
The interface segregation principle (ISP) states that clients should not be forced to depend upon interface methods that they do not use.
Importance:
The dependency inversion principle (DIP) states that one should depend upon abstractions, not concretes.
Importance: