The Decorator of Jsonnet
Adding behavior to objects dynamically via mixins.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Decorator
ARCANUM SCHOOL: Transmutation // Aura Enhancement
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// JSONNET PATTERN //
local BaseService = {
port: 8080,
protocol: "http"
};
local WithMetrics = {
metrics_enabled: true,
metrics_port: 9090
};
local WithLogging = {
logging_level: "debug"
};
{
service: BaseService + WithMetrics + WithLogging
}
Using Jsonnet’s mixin capabilities (+), the Decorator pattern enhances base configurations with supplementary traits seamlessly, creating a robust artifact.
Runic Tags:
#structural
#decorator
#jsonnet