Misc New Info Flashcards

1
Q

what does having fields within classes that are only used by a small fractin of the public methods potentially indicate?

A

low cohesion
- cohesive classes generally have a small # of private fields that make sense to a majority of the public methods in that class

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

Which Design Patterns encourage the single responsibility principle?

A
  • strategy pattern
  • command pattern
  • state pattern
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

instanceof/typeof checks are a common code smell for _______

A

violating the open/closed principle

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

Indicate in Strategy Design Pattern where and why you might add a factory

A

notes

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