3 ms·
Entities are a collection of component instances and nothing more. Components in ECS are data-only. Systems in ECS are logic-only. If you follow this strictly,
by DecoPerson 6y ago
Entities are a collection of component instances and nothing more.
Components in ECS are data-only.
Systems in ECS are logic-only.
If you follow this strictly, then you cannot support encapsulation or data-hiding. There is no sole definition of OOP, but it is widely accepted that the ability to do encapsulation, including data-hiding, is a key part of OOP.
Therefore, ECS is not OOP.
QED
If you’ve not seen the Overwatch team’s talk in which they discuss ECS, I can highly recommend it as a good resource to learn about ECS: https://youtu.be/W3aieHjyNvw https://youtu.be/W3aieHjyNvw
There may be models commonly used in those languages you mentioned that are similar to ECS, but you seem to be implying that ECS is a form of OOP; it is not.
Even if you implemented OOP using Structs of Arrays, a thread per object, or whatever you like, you cannot strictly conform with ECS’s requirement that “components have no logic” while also strictly conforming with OOP’s requirement that “objects should not know about each others’ internals” (object hierarchy).
- pjmlp 6y agoECS is definitly OOP, just not for those that don't bother reading SIGPLAN papers from the 80 and 90's and the multitude of approaches to OOP and the object, prototype or component based variants thereof, and are stuck with the concept that OOP == Smalltalk-80 as they learned C++ OOP from some C with Classes book. I guess I need to find some time to prove my point, port ECS examples to Objective-C, Eiffel and CLOS, and provide links to some of those papers as well. A bit more love for ACM and IEEE goes along way in acquired knowledge.