Singleton
Ensure a magical singularity or nexus core exists exactly once within the leyline network.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Singleton
ARCANUM SCHOOL: Evocation // Nexus Anchoring
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// D PATTERN //
class NexusCore {
private this() {}
private static __gshared NexusCore instance;
static NexusCore getInstance() {
if (instance is null) {
synchronized(NexusCore.classinfo) {
if (instance is null) instance = new NexusCore();
}
}
return instance;
}
}
A unified anchor point in the arcane weave, accessible globally.
Runic Tags:
#creational
#singleton
#dlang
#thread-safe