The Factory Method Effect
A creational incantation delegating the instantiation of magical entities to effect handlers.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Summoning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
effect summoner
ctl summon-familiar() : string
fun fire-mage(action : () -> <summoner|e> a) : e a
with handler
ctl summon-familiar() resume("Fire Salamander")
action()
fun water-mage(action : () -> <summoner|e> a) : e a
with handler
ctl summon-familiar() resume("Water Undine")
action()
pub fun main()
println(fire-mage { "Summoned: " ++ summon-familiar() })
println(water-mage { "Summoned: " ++ summon-familiar() })
Runic Tags:
#koka
#factory-method
#summoning
#effects