3 ms·
I'm confused. ECS is a type of OOP, is it not? An entity is an object in the same way a model is an object.
by ehnto 5y ago
I'm confused. ECS is a type of OOP, is it not? An entity is an object in the same way a model is an object.
- tsimionescu 5y agoI think one of the most core ideas of OOP is encapsulation, and in this way ECS is radically opposed to OOP.
- ratww 5y agoNot really. An "Entity" in most modern ECS implementations is normally implemented as an integer, which is used as a handle to which multiple components refer to. A "Component" is normally implemented as a struct, and a "System" as a standalone function. No encapsulation here. Of course you would have to implement all of the above using classes and objects if your language doesn't have support for structs or standalone functions, but that's just an implementation detail. The concept itself is not a subset of OOP, and breaks many "rules" of OOP.