SOLID Principles Flashcards
SOLID is a
mnemonic for five design principles intended to
make software designs more understandable, flexible and
maintainable.
Single Responsibility Principle
A class should have just one reason to change.
Open/Closed Principle
Classes should be open for extension but closed for modification.
Liskov Substitution Principle
When extending a class, remember that you should be
abletopassobjectsofthesubclassinplaceofobjectsof
the parent class without breaking the client code.
Interface Segregation Principle
Clients shouldn’t be forced to depend on methods they
do not use.
Low-level classes
implement basic operations such as working with a disk, transferring data over a network, connecting to a
database, etc.
Dependency Inversion Principle
High-level classes shouldn’t depend on low-level class-
es. Both should depend on abstractions. Abstractions
shouldn’t depend on details. Details should depend on
abstractions.
High-level classes
contain complex business logic that directs
low-level classes to do something.