🐎 PONY WARD DIFFICULTY: Adept Creational

The Builder Ward

Constructing complex magical constructs step-by-step in isolation.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Conjuration // Golemancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PONY PATTERN //
class iso GolemBuilder
  var _arms: U32 = 0
  fun ref add_arms(n: U32): GolemBuilder ref =>
    _arms = _arms + n
    this
  fun consume build(): Golem iso^ =>
    recover Golem(_arms) end

The Builder Ward

Step-by-step conjuration of complex entities is vulnerable to interference. By keeping the builder iso (isolated) or ref, we ward off data races during the crafting process, finally consuming it to yield a fresh iso construct ready to be passed to another actor.

Runic Tags: #pony #builder #reference-capabilities