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
2
Q
Which Design Patterns encourage the single responsibility principle?
A
- strategy pattern
- command pattern
- state pattern
3
Q
instanceof/typeof checks are a common code smell for _______
A
violating the open/closed principle
4
Q
Indicate in Strategy Design Pattern where and why you might add a factory
A
notes