by pepemysurprised · 5y ago · 0 comments
Recently I'm starting to like this type of programming over OOP. Each part of your application accesses a global in-memory DB with the full state. But unlike a traditional persistent db it's really fast.
https://www.amazon.com/Component-Software-Object-Oriented-Pr...
Programming against Objective-C protocols, COM interfaces, Component Pascal framework, and so forth.
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.
I didn't say it was. The key par was "state is managed seperately from logic."
> Component programming with interface separated from state
There is no such things as interfaces in ECS. Interfaces are a way of describing how state is bundled with logic. ECS does not do that.
> Those that promote ECS as not being OOP 99% of the times never read books like the one I linked on my comment.
I'll admit that I have not read that book. Your condescending appeal to authority here doesn't actually promote conversation.
Please, tell me what the "objects" are in ECS or what else qualifies it as OOP?