6 ms·
I'm curious if anyone has used ECS in a business application? Our application has a lot of business rules between our different entities. Currently we use some
by reidjs 5y ago
I'm curious if anyone has used ECS in a business application?
Our application has a lot of business rules between our different entities. Currently we use something like MVC and the rules mainly live in the models themselves. This can be a messy when describing rules between objects.
- codr7 5y agoThis is pretty much a solved problem in languages with multiple dispatch (Common Lisp, Julia, Raku etc), the behavior lives in the methods which don't belong to a specific class. You can sort of, kind of get there with free functions and overloading as long as you're not doing anything fancy with the methods.
- NovaX 5y agoentity = instance id component = metadata + data system = metadata processors This way you can decouple business rules from the model by using metadata to instruct how the entity should be processed. At work we use json schema as our type system to describe our entities, where every instance includes the schemas that it implements. The metadata allows us to render an entity, process it via server-side triggers, store and search, use generic crud routes, etc. In a language like Java, this is the same as using reflection to inspect interfaces and annotations for processing an object.