Component Family Map

leaf viewmodels, modeled payloads, readonly projections, and the uniform lifecycle surface

Component Family Map leaf viewmodels, modeled payloads, readonly projections, and the uniform lifecycle surface Component Family Map leaf viewmodels, modeled payloads, readonly projections, and the uniform lifecycle surface Leaf lineage Leaf behavior surface Host and parent seams ComponentVMBase lifecycle state hub + dispatcher construct/destruct hooks ComponentVM plain leaf no model payload addressable VM surface ComponentVM<M> mutable model payload ModeledHint recomputes model change notifications ReadonlyComponentVM<M> immutable projection assignment rejected safe display leaf Selection commands Select / Deselect Toggle selection next/previous inert on leaf Parent back-reference owned by container drives can_select() cleared on removal Dual-channel helper equality + assignment first hub message exactly once inert after disposal Per-instance binding local notification second view adapter subscribes once current value is observable Used by containers CompositeVM rows GroupVM peers AggregateVM slots Used by examples NoteVM NotebookVM Status panels Wrapped when needed ForwardingComponentVM instrumentation without copying policy and host adapters Decision rule Start with ComponentVM for a single addressable thing; move to a container only when the VM owns children. extends modeled readonly commands parent context hub first local second example leaves wraps

Leaf ownership

  • ComponentVM owns one addressable surface and no children.
  • Modeled variants add payload semantics without changing the lifecycle contract.
  • Readonly modeled leaves are projections for immutable state.

Uniform behavior

  • Leaf VMs still expose lifecycle, selection, property, and command surfaces.
  • Selection is parent-aware, so a standalone leaf cannot accidentally select itself.
  • Model and hint updates are observable through hub and per-instance binding streams.

Best fit

  • Use leaves for rows, panels, action bars, status blocks, and render-ready projections.
  • Wrap leaves with forwarding decorators when adapting behavior is cleaner than subclassing.
  • Promote to Composite, Group, Aggregate, or Hierarchical only when child ownership appears.