A class should have one and only one reason to change, meaning that a class should have only one job.
the open/closed principle states that software entities (classes, modules, functions, etc.) should be open for extensions, but closed for modification.
LSP: LISKZOV 替换法则
if S is a subtype of T, then objects of type T may be replaced (or substituted) with objects of type S.
no client should be forced to depend on methods it does not use
- Do not add additional functionality to an existing interface by adding new methods
- create a new interface and let your class implement multiple interfaces if needed
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.