The SOLID principles are a set of basic principles for designing OO programs. The name itself is a acronym, with each of the five principles named after one of the letters: Single responsibility, Open/closed, Liskov substitution, Interface segregation, and Dependency inversion. The principles act as a set of guidelines to help you implement code that is easy to maintain and extend over time. The SOLID acronyms was coined by Robert C. Martin (a.k.a. Uncle Bob).
Each of the principles corresponds to a set of potential code smells that can exist in your code, and they offer a route out of the problems that they cause.
Initial | Acronym | Concept | Author |
---|---|---|---|
S | SRP |
The Single Responsibility Principle
A class should have only one reason to change. |
Robert C. Martin |
O | OCP |
The Open Closed Principle
Software entities should be open for extension, but closed for modification. |
Bertrand Meyer |
L | LSP |
The Liskov Substitution Principle
Methods that use references to base classes must be able to use objects of derived classes without knowing it. |
Barbara Liskov |
I | ISP |
The Interface Segregation Principle
No client should be forced to depend on methods it does not use. |
Robert C. Martin |
D | DIP |
The Dependency Inversion Principle
Depend upon abstractions. Do not depend upon concrete classes. |
Robert C. Martin |
Other important principles:
Reference: Wikipedia