SOLID is an acronym for the first five object-oriented design principles:
- Single Responsibility Principle states that every module or class should have responsibility over a single part of the functionality provided by the software.
- Open/Closed principle states that software entities (classes, modules, functions, etc.) should be open for extensions, but closed for modification.
- Liskov substitution principle states that if S is a subtype of T, then objects of type T may be replaced (or substituted) with objects of type S.
- In other words, it states that objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
- Interface segregation principle states that no client should be forced to depend on methods it does not use.
- High-level modules should not depend on low-level modules. Both should depend on abstractions.
- Abstractions should not depend on details. Details should depend on abstractions.
- Cleaner code
- Easier to test
- Easier to maintain
- Reusable
- Readable
- Extensible