I like these approaches:
- Outboard component-based entity system architectureEvolve Your Hierarchy
- Entity Systems are the Future of MMOs Part 5
Shortly: Avoid mixing inheritance withkeeping update behavior within components. Components are not behavior. Behavior is(including updates) can be implemented in some single-instancedinstance subsystems. In such way you can easy manageThat approach might also help to batch-process similar behaviors for multiple components (maybe using parallel_for or SIMD instructions on component creationdata).
The IUpdatable idea and Update(gametime dt) method seems a bit too restrictive and introduces additional depencencies. It might be fine if you are not using subsystems approach, templatingbut if you do use them, then IUpdatable is a redundant level of hierarchy. After all, the MovingSystem should know that it must update the Location and also storing game entity structure/or Velocity components directly for all entities which have these components, so there is no need for some intermediate IUpdatable component.
But you could use Updatable component as a mechanism to skip updating some entities despite of them having Location and current state in/or Velocity components. The Updatable component could have a relational databasebool flag which can be set to false and that would signal every Updatable-aware subsystem that this particular entity currently should not be updated (although in such context, Freezable seems to be more appropriate name for the component).