gradle-native
gradle-native copied to clipboard
Ensure all ModelComponent respect the Equal contract
We caught some duplication issues because we were eagerly configuring a component on the entity. In this example, we were providing an implicit ParentComponent
to all entities based on their ModelPath
. We are moving from this implicit behaviour, however, for this particular case, the equality of the ParentComponent
should have led to a no-op in terms of system triggering. Because the ParentComponent
does not respect the Equal contract, both component instances are treated differently causing duplicated triggers in the system. The goal is to move toward managed components which would automatically provide all the required contracts. However, managed components are only an implementation detail and hand-rolled component should still be correct. We should consider checking those requirements at runtime (once per component type) to ensure compliance.