Fracanto Dependency Injection

Fracanto Dependency Injection #4 — Interplay with the vtable Pattern

Interplay — DI and vtable at different abstraction levels

DI and the vtable pattern complement each other in the three-tier architecture: the vtable pattern defines the interfaces between framework tiers (what can a panel do? what can an audio pipeline do?), while DI abstracts hardware access within drivers (how do I read SPI? how do I control GPIO?). Both use the same mechanism — function pointers with void *ctx — at different levels of abstraction.