Skip to content

Architecture Rules ​

MVT architecture rules have moved to the Architecture section. This page provides quick-reference tables linking each rule to its documentation.

See: Architecture Rules (full) - Style Guide - Glossary


Universal MVT Rules ​

These apply to any MVT implementation regardless of language or renderer. The canonical definitions live in Architecture Rules.

Model Rules ​

RuleConstraintReference
M-timeAll state advances through update(deltaMs) onlyArchitecture Rules
M-isolationModels must not reference views or the tickerArchitecture Rules
M-domainState uses domain-level terms, not presentation termsArchitecture Rules
M-compositionParent models delegate update(deltaMs) to childrenArchitecture Rules

View Rules ​

RuleConstraintReference
V-statelessViews hold no domain stateArchitecture Rules
V-refreshrefresh() runs once per frame, after all models have updatedArchitecture Rules
V-idempotentrefresh() must be idempotentArchitecture Rules
V-readonlyrefresh() must not mutate modelsArchitecture Rules
V-reactiveQuery bindings given as functions must be re-read in refresh(), never cachedArchitecture Rules
V-presentationViews may hold cosmetic presentation state the model does not trackArchitecture Rules
V-outputViews can target any output technologyArchitecture Rules
V-treeView trees do not need to mirror model treesArchitecture Rules

Ticker Rules ​

RuleConstraintReference
T-sequenceEach frame follows strict order: update, advance view state, refresh, renderArchitecture Rules
T-capCap deltaMs to a safe maximumArchitecture Rules
T-minimalThe ticker contains no domain logic and no rendering codeArchitecture Rules
T-controlThe ticker may pause, slow, speed up, or single-step timeArchitecture Rules

Binding Rules ​

RuleConstraintReference
B-contractBindings are the contract between a view and the worldArchitecture Rules
B-reusableReusable leaf views use a bindings interface; top-level views may access models directlyArchitecture Rules
B-optionalRelay bindings should usually be optionalArchitecture Rules
B-wiringBindings are wired at the view construction siteArchitecture Rules

Hot-Path Rules ​

RuleConstraintReference
H-costMinimise per-tick computation costArchitecture Rules
H-allocAvoid per-tick heap allocations in update() and refresh()Architecture Rules
H-loopsUse index-based loops and pre-allocated structuresArchitecture Rules
H-changeUse change detection for rare but expensive updatesArchitecture Rules

Repo-Specific Conventions ​

These are style and structural choices for this project, not MVT requirements. See the Style Guide for full details.

ConventionReference
Factory functions, not classesStyle Guide
String-literal unions, not enumStyle Guide
Kind not Type, phase not stateStyle Guide
Barrel imports onlyProject Structure
4-space indentationStyle Guide