|
|
|
|
|
by pjmlp
1826 days ago
|
|
OOP is not inheritance, just one possible trait among OOP implementations, just like FP isn't Haskell. Component programming with interface separated from state is exactly what Objective-C protocols, COM, VBX, SOM, Component Pascal were all about. Those that promote ECS as not being OOP 99% of the times never read books like the one I linked on my comment. Instead they reference a talk done at GDC by one of the very first engines that made it well known to those that never read CS papers or books. |
|
In ECS (where Components are a bag of data, and systems handle all logic/operations), and like a DB, the object is defined by an id and its relations; from the relations, you can derive available capabilities.
That is, an object tells you what it can do. In a DB, what it can do tells you the object.
You can create the same system with interfaces by simply ignoring the methods part of it, and keeping the data part, but associating data with capabilities is pretty much the defining difference between objects and structs.
More importantly from an architectural perspective, in ECS the logic isn’t associated with the object, it’s associated with a system that takes the object as input. The system is shared across all objects. The object (entity) for ECS is little more than an id and some relations.
An ECS very directly corresponds to an RDBMS. To call it OOP is to deny the ORM’s classic Object-Relational mismatch.