S.O.L.I.D is an acronym for the five basic principles of object-oriented programming and design identified by Robert C. Martin (Uncle Bob) in the early 2000s. The principles when applied together intend to make your code easy to maintain and extendable.
1- Single Responsibility Principle:
every object should have a single responsibility, and that responsibility should be entirely encapsulated by the class.
2- The Open-Closed Principle:
the class should be open for extension but closed for modification .
3- Liskov substitution Principle:
it states that derived class should be substitutable for their base class. which means that if I substitute the derived class to its base class every thing should work with the same behavior and give me the same output .
4- Interface Segregation Principle:
it states that clients should not be forced to depend on methods they do not use . Don’t build fat Interfaces, only small cohesive interfaces to be matched with the client needs.
5- Dependency inversion Principle:
it states that high-level classes should not depend on low-level class. both should depend on abstraction. and abstraction should not depend on details but details should depend on abstraction. which means that you should depend on a concept not on an implementation.