1. Introducing SOLID Flashcards

1
Q

What are the two principles of Pain-Driven Development?

A
  1. Avoid premature optimization

2. If the current design is painful to work with, use principles to guide the redesign

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

When should we apply the SOLID principles?

A

As your application grows and you continue to work with it, look for places where the app is painful to work with. That pain may exhibit itself as difficulty with testing or excess duplication, too much coupling, etc. When you feel that pain, see if any of the SOLID principles could be applied to alleviate the pain and improve the design.

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

What are the SOLID principles?

A

S — SRP — Single Responsibility Principle
O — OCP — Open Closed Principle
L — LSP — Liskov Substitution Principle
I — ISP — Interface Segregation Principle
D — DIP — Dependency Inversion Principle

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

What are the SOLID principles comprised of?

A

Five individual principles for writing better software, especially in object-oriented languages.

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

What can be said about applying SOLID principles upfront while solving problems in code?

A

Write your code using the simplest technique you know to get the problem solved. Don’t worry about SOLID initially. Trying to apply all of the SOLID principles upfront is a form of premature optimization of your app’s design. If the current design is painful to work with, use the principles to guide redesign.

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