jonnify·bcs /bcs/elixir-core/archetypes

B2 · module 4 of 6 · Archetypes and Composition

Archetypes and Composition.

An archetype is an entity in the ARC namespace whose value is a property bundle, optionally extending one parent through :extends; an entity carries an archetype’s id plus its own overrides, and the composed view is a pure fold computed at read time.

Three dives: archetypes as data rather than code, composition as a pure fold whose boundary is injected, and the single :extends link that makes inheritance a bounded chain with no class diamond.

ARC bundles in an extends chain fold through compose into a read-time view. Select a part.
ARC basea property bundleARC child:extends base compose(chain, overrides)Map.merge, root-firstoverrides last, right-most wins entity overrides composed viewa map, at read timeno :extends key
readout · Select a part. An archetype is an ARC bundle naming one parent via :extends; compose folds the chain with Map.merge, overrides last; the view is a plain map built at read time.
§1

The three dives

each a leaf, the teaching
§2

The module, in one law

echo_data · bcs/archetypes.ex

B2.4 reads archetypes as data and composition as a pure fold. An archetype is an entity in the ARC namespace whose value is a property bundle, optionally extending one parent through an :extends key; an entity carries an archetype’s id plus its own overrides; and the composed view is computed at read time by folding the chain — base first, descendants after, overrides last. Three dives: archetypes as data rather than code, composition as a pure fold whose boundary is injected, and the single :extends link that makes inheritance a bounded, cycle-checked chain with no class diamond. Grounded in EchoData.Bcs.Archetypes, and pointed at the tile and player kinds Codemojex grows at runtime.

§4

The doors

the sibling courses
§4

References

sources · related

Sources

Related