Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've described an ECS to my friend as a combination Strategy pattern and Composition, so you can have a huge list of "traits/components/behaviours" and then build your object hierarchies (and their behaviours) from that, instead of from Inheritance. The way most game editors are made, when you configure things using the ECS, it visually looks like inheritance, but under the hood it is more like Composition. Once you go down the rabbit hole, you would see that and ECS/Strategy pattern & Composition makes more sense (and way easier to cater to exceptions) than plain old inheritance.

I want dare say that the enterprisey-version of an ECS would be the Onion Architecture that's been floating around in Java/C# camps. Not 100% match but they feel the same to me.

Obviously for normal GUI programming (at the outer layer that we see at least), inheritance is still king.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: