The Mediator of Jsonnet
Centralizing complex communications between objects.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Mediator
ARCANUM SCHOOL: Enchantment // Nexus Control
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// JSONNET PATTERN //
local Mediator(config) = {
db_url: "db://" + config.db.host + ":" + std.toString(config.db.port),
api_endpoint: "http://" + config.api.host + "/v1"
};
local DBConfig = { host: "db-server", port: 5432 };
local APIConfig = { host: "api-server" };
{
system_links: Mediator({ db: DBConfig, api: APIConfig })
}
The Mediator centralizes the relationships between distinct configuration fragments, weaving them into a cohesive environment without them directly coupling.
Runic Tags:
#behavioral
#mediator
#jsonnet