SOLID Flashcards
1
Q
What are the solid principles
A
Single responsibility Open/closed principle Liskov substitution Interface segregation Dependency inversion
2
Q
What is liskov substitution
A
If class A is a subtype of Class B then we should be able to replace Class B with A without disrupting the behavior of the program
3
Q
Interface segregation
A
Larger interfaces must be split into smaller ones , by this we can ensure that implementing classes are only concerned about methods that are of interest to them
4
Q
Dependency inversion
A
Refers to decoupling of software modules
High level modules must not depend on low level modules. they must be dependent only on abstractions
The idea is to compose a class with its dependent classes and inject the dependencies through a constructor instead of doing new