🕸️ WASM HOMUNCULUS DIFFICULTY: Adept Creational

The Factory Method

Delegating the instantiation of volatile engine spirits to localized sub-routines.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Spirit Binding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// WASM PATTERN //
(module
  (func $spawn_spirit (param $type i32) (result i32)
    (if (result i32) (i32.eq (local.get $type) (i32.const 1))
      (then (i32.const 0x5P1R1T))
      (else (i32.const 0xDEM0N))
    )
  )
)

The Factory Method

To bind volatile engine spirits to the WASM stack, one must delegate the ultimate decision of their form to subclasses. The Factory Method defines an interface for birthing these spirits, allowing localized sub-routines to alter the spirit’s spectral signature at runtime.

Runic Tags: #WASM #Binding #Spirits