17
Status undeclaredS05-CON-007UndeclaredSource imported
Section 26 of 102
25. Inheritance, Composition & Reuse
Stable section ID: S05-CON-007-SECTION-26 · 29 content blocks
BDL shall support reuse through inheritance, composition, templates, and parameterization.
Inheritance may define specialization:
type TimberEndCartridge extends StructuralEndCartridge {
required timber_grade: TimberGrade;
required moisture_limit: Quantity<Percent>;
}
- A subtype shall satisfy all mandatory requirements of its parent Type.
- Inheritance shall not be used to redefine inherited semantics incompatibly.
Composition shall assemble complex definitions from smaller Types:
- assembly BathroomServiceCartridge {
- contains: [
- @ColdWaterModule,
- @HotWaterModule,
- @WastewaterModule,
- @ElectricalModule,
- @LeakSensorModule
];
}
Composition shall be preferred where independent subcomponents possess separate identities, lifecycles, or replacement requirements.
Templates may define reusable patterns:
- template StandardRoom<TWidth, TLength> {
- space Room {
width: TWidth;
length: TLength;
area: TWidth * TLength;
}
}
- Every instantiated template shall generate traceable entity identities.
- Reuse shall not conceal regional or project-specific changes. Overrides shall be explicit and validated.