Browse Java Design Patterns & Enterprise Application Architecture

State vs. Strategy Pattern

Compare State and Strategy in Java so caller-selected algorithms and lifecycle-driven behavior changes do not get confused.

On this page

State and Strategy often look similar because both delegate behavior through an interface. The difference is why the behavior changes.

Strategy

Behavior changes because:

  • the caller chooses an algorithm
  • configuration selects a policy
  • the system wants interchangeable behaviors

State

Behavior changes because:

  • the object is now in a different lifecycle state
  • the meaning of an operation depends on current internal status

Java Shortcut

Ask:

  • “Who chooses the behavior?” If it is the caller or configuration, think Strategy.
  • “What changed inside the object?” If it is lifecycle or status, think State.

They can share structure, but they solve different runtime problems.

Revised on Thursday, April 23, 2026