I have a couple questions regarding entity-component systems. From my reading, it seems that components are to be "data only". Does this mean they should not contain any functions? Say, for instance, I have a "movement" component. This would be given to entities that are able to move, and it would contain variables such as speed, acceleration, max speed, etc. Would it not make sense to give this component the functions that deal with with collision detection and updating position?
Second question. This entity-component system is aimed to replace the inheritance structure of traditional OOP. Does this mean inheritance should be avoided all together when using such a system, or are there cases where it can be used to create a sort of hybrid system? I can imagine using inheritance with the components themselves (such as when some objects require different types of physics calculations).
Third question. In implementing an entity-component system, what does this actually do to the compiled program? As opposed to a traditional inheritance structure, does the compiled program take up more hard drive space? Does it take more processing power to run? Is there more overhead? If so for any of those, by how much?
Edit: Fourth question. What would warrant a project to make use of an entity-component system over a traditional inheritance structure? Is it something that should be used without exception, or is it really only beneficial for games with a large scope and with many programmers working on it?
Edited by Ludus, 08 April 2013 - 08:13 PM.