Skip to content

Compono.PlanCache T

Compono

Compono

PlanCache\<T> Class

Holds the generated ICompositionPlan<T> for T, per docs/adr/0004-composition-plan-discovery-and-dispatch.md's dispatch mechanism.

public static class PlanCache<T>

Type parameters

T

The type the cached plan constructs.

Inheritance System.Object → PlanCache\<T>

Remarks

A closed generic static field is one field per closed generic type in the CLR, so Instance is a direct field read on Composer's hot path — not a typeof(T)-keyed dictionary lookup, and not runtime reflection.

Instance is populated exactly once, by a generated module initializer in the consuming assembly (never by Compono itself) — this is why the setter has to be public despite the "no static singletons" rule in coding-standards.md: cross-assembly generated code has no other way to reach it. This is a deliberate, ADR-recorded exception to that rule, not an oversight.

Properties
Instance The generated plan for T, or null if none has been registered — either because T was never discovered at a Composer.Create<T>() call site, or because the consuming assembly's module initializers haven't run yet.