Multiple choice technology architecture

Allow and object to change its state when it’s internal state changes. The object will appear to change its class.

  1. Decorator

  2. Observer

  3. State

  4. Strategy

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The State pattern allows an object to change its behavior when its internal state changes, making it appear as if the object has changed its class. This is exactly what the question describes. Decorator adds responsibilities dynamically, Observer notifies dependents of state changes, and Strategy encapsulates interchangeable algorithms.