Re:Clear is better than clever
by stcredzero on Monday July 08, 2019 @06:25PM
(#20387341)
separate operational classes that work on data, and data classes that hold values
This is how I view Entity Component System. It's kind of re-mapped Object Oriented, with strict Areas of Concern.
I wish we named all kinds of ECS-es. It's a total confusion of terms now. Your view is one kind of ECS. Another view is "structuring data to be cache-friendly". Another is "data feels better when modeled and accessed in relational fashion". Yet another is "composition over inheritance taken up to 11". People mix and match these views, which is why every single article on ECS seems to be talking about something different from every other article.
Re:Clear is better than clever
by stcredzero on Tuesday July 09, 2019 @01:08PM
(#20394073)
Your view is one kind of ECS. Another view is "structuring data to be cache-friendly". Another is "data feels better when modeled and accessed in relational fashion". Yet another is "composition over inheritance taken up to 11".
You can do all 4 of those at the same time!
I believe you can, though I've not been there myself. But all the articles I've read and all the ECS implementations I've studied so far usually focus on one, maybe two of those aspects at a time, so every one looks different from another.
(In my current side project, I have relaxed performance requirements, so I'm experimenting with taking the relational aspect up to 11.)
Re:Clear is better than clever
by stcredzero on Tuesday July 09, 2019 @04:48PM
(#20396423)
Maybe I'm not so sure what you mean by "taking the relational aspect up to 11." My side project is in golang, so composition over inheritance isn't really an issue. I guess that leaves me with just 2 of the aspects.
When I'm in C# by contrast, I often get irritated that I can't just have a couple functions that I can reuse, no, I have to create as static class, ideally in a namespace and do a bit more. I do try to minimize the complexity of my classes and separate operational classes that work on data, and data classes that hold values.