Fracanto Vtable Pattern

Fracanto Vtable Pattern #3 — Usage in the Framework

Usage in the Framework — vtables across all layers

The same pattern runs through the entire three-tier architecture. The panel abstraction defines panel_ops_t with four generic operations (init, deinit, tick, set_led), through which the io_ops_t in the IO manager abstracts ADC and DAC access, and the audio pipeline uses audio_ops_t for DMA-based audio processing. At tier 2, the module scaffold defines the 17 callbacks via module_ops_t that a concrete module must implement.

Four of the five peripheral drivers (ADS8866, DAC8552, PCM5102A, Encoder) implement a framework vtable and additionally use dependency injection to supply hardware dependencies from outside rather than creating them internally. The SSD1306 OLED driver uses only dependency injection with a standalone API but does not implement a framework vtable.