The State of the Finite Machine
Swapping out behavior based on the current tier of corruption.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Phase Shifting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// VB PATTERN //
' IState.cls
Public Sub Handle(context As Object)
End Sub
' CorruptedState.cls
Implements IState
Private Sub IState_Handle(context As Object)
MsgBox "System is corrupted. Ignoring input."
' Transition to catastrophic failure
End Sub
When an application’s logic is paralyzed by complex conditional blocks tracking “modes”, the State pattern encapsulates each mode into its own object, cleanly managing the descent into madness.
Runic Tags:
#state
#fsm
#behavior