| SOLID |
|---|
| Principles |
In object-oriented 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 can also form a core philosophy for methodologies such as agile software development and adaptive software development. [1]
Software engineer and instructor Robert C. Martin [2] [3] [1] introduced the basic principles of SOLID design in his 2000 paper Design Principles and Design Patterns about software rot. [3] [4] : 2–3 The SOLID acronym was coined around 2004 by Michael Feathers. [5]
The single-responsibility principle (SRP) states that there should never be more than one reason for a class to change. [6] In other words, every class should have only one responsibility. [7]
Importance:
The open–closed principle (OCP) states that software entities should be open for extension, but closed for modification. [8]
Importance:
The Liskov substitution principle (LSP) states that functions that use pointers or references to base classes must be able to use objects of derived classes without knowing it. [9] [9]
Importance:
The interface segregation principle (ISP) states that clients should not be forced to depend upon interfaces that they do not use. [10] [4]
Importance:
The dependency inversion principle (DIP) states to depend upon abstractions, not concretes. [11] [4]
Importance: