Avoids Conditional Logic:?
- The pattern eliminates the need for complex conditional logic (e.g., if or
switch statements) in the context class. Each state class defines its own
behavior, and the context class only delegates the work.
switch statements) in the context class. Each state class defines its own
behavior, and the context class only delegates the work.