But... I realize every time that I forget what an entity, component and system really "is" (i mean to be fair the naming is almost satire of genericness), and the abstraction doesn't stick to my brain in a way that I had hoped. Kinda similar to how monads don't stick, and fades away over time (if you're not doing FP). Usually, this is a red flag for abstractions, but perhaps the material I've read has been poorly written. Does this feeling go away when you're used to it? Does it just feel natural and obvious after a while?
An attempt to hide private pieces of data may be counter-productive when an entity system tries to globally optimize the handling of state. A lack of protection though may result in inadvertently depending on parts of data that are a fleeting implementation detail; tight coupling has its own problems.
https://www.gamedev.net/blogs/entry/2265481-oop-is-dead-long...
> I've been a long-time ranter in many "ECS" threads on the forum, partly because I don't think it deserves to exist as a term (spoiler: it's just a an ad-hoc version of the relational model), but because almost every single blog, presentation, or article that promotes the "ECS" pattern follows the same structure:
> 1. Show some terrible OOP code, which has a terribly flawed design based on an over-use of inheritance (and incidentally, a design that breaks many OOD rules).
> 2. Show that composition is a better solution than inheritance (and don't mention that OOD actually teaches this same lesson).
> 3. Show that the relational model is a great fit for games (but call it "ECS").
> This structure grinds my gears because:
> (A) it's a straw-man argument.. it's apples to oranges (bad code vs good code)... which just feels dishonest, even if it's unintentional and not actually required to show that your new architecture is good, but more importantly:
> (B) it has the side effect of suppressing knowledge and unintentionally discouraging readers from interacting with half a century of existing research.
Sorry for the lengthy quote, but I reckon this article is a classic.
- Avoid the inheritance vs. composition issue
- Entity as a first-class concept (no more Object vs. "Just Value Object", confusion regarding equality of objects, object hash methods)
- System as a first-class concept (not just a consequence of a call stack between multiple inter-dependent objects)
- It serves much of the same purpose of the Flyweight Pattern
- Naturally conductive of functional programming
This particular implementation is interesting, it introduces some additional pieces (Component Manager, System Manager).