Entity Component System Architecture
Composition over inheritance for game objects — why ECS scales where class hierarchies collapse.
Traditional OOP game engines use deep inheritance hierarchies: GameObject → Character → Enemy → FlyingEnemy → FlyingEnemyWithShield. Every new combination requires a new class. ECS inverts this: entities are just IDs, components are pure data bags, and systems are functions that operate on components. Composition replaces inheritance.
Data-Oriented Design
ECS isn't just an organizational pattern — it's a performance strategy. Components of the same type are stored contiguously in memory. When a system iterates over all Position components, it's walking a flat array with perfect cache locality. This is why ECS-based engines can simulate millions of entities where OOP hierarchies choke at thousands.