SOLID Flashcards

1
Q

What are the solid principles

A
Single responsibility 
Open/closed principle 
Liskov substitution 
Interface segregation 
Dependency inversion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly