Mid GoF Patterns

State Transitions:?

  • Each time the Change method is called, the current state will perform its

action and then set the next state, allowing the traffic light to cycle through its

states (Red → Green → Yellow → Red).

Benefits of the State Pattern:

More from Design Patterns in C#

All questions for this course