Flyweight: Smalltalk
Share ectoplasmic state efficiently to support vast numbers of weak poltergeists.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Flyweight
ARCANUM SCHOOL: Conjuration // Ectoplasm Pooling
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SMALLTALK PATTERN //
Object subclass: #EctoplasmPool
instanceVariableNames: 'sharedEssences'
classVariableNames: ''
package: 'Tekromancy-Seance'.
EctoplasmPool >> essenceFor: emotionType [
^ sharedEssences at: emotionType ifAbsentPut: [ Ectoplasm newType: emotionType ]
]
When manifesting a thousand screaming souls, one must conserve memory by pooling shared spectral essence.
Runic Tags:
#smalltalk
#structural
#seance