SOLID Flashcards

1
Q

SOLID

A

S - Single Responsibility Principle (SRP)

Keep each class focused on one responsibility.

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

SOLID

A

O - Open/Closed Principle (OCP)

Extend classes with new functionality without changing existing code.

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

SOLID

A

L - Liskov Substitution Prinicple

Subclasses should be replaceable for their parent class without issues.

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

SOLID

A

I - Interface Segregation Principle

The Interface Segregation Principle (ISP) states that no client should be forced to depend on methods it does not use. In other words, it’s better to have many small, specific interfaces than one large, general-purpose interface. This way, clients only implement the methods they actually need, keeping the system more modular and easy to maintain.

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

SOLID

A

D - Dependency Inversion Principle

The Dependency Inversion Principle (DIP) states that high-level modules should not depend on low-level modules. Both should depend on abstractions (like interfaces or abstract classes). Additionally, abstractions should not depend on details. The details (concrete implementations) should depend on abstractions.

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