SOLID principles

Single Responsibility
Class should have a single, well-defined responsibility and should not be responsible for multiple things.
Open-Closed
Software enteties (classes, modules, functions) should be open for extension but closed for modification. You should be able to add new functionality to class without changing its existing code.
Liskov Substitution
Objects of a subclass should be able to be used in the same way as objects of parent class without issues.
Interface Segregation
Classes shouldn’t have to implement interfaces that they don't need.
Dependency Inversion
High-level modules (i.e., classes depending on other classes) should not depend on low-level modules. Both should depend on abstractions. So, it's easier to change implementation of low-level module without affecting high-level module.
Comments