Should a system be accessing the attributes of a component, and if that component does not have a value for that attribute, can it call a function to get that value?
Consider also the case the component has value, is its ability to recompute the attribute removed? What about conflicting values? I.e. a component is defined with attributes, but the function to compute a particular attribute returns a different value than the one that is defined. How to handle?
Or should every attribute that a system wants to extract from a component/subsystem be accessed with a "get_attribute()"?
How about placing a "if self.attribute exists, return the attribute" instead of computing the value? Or on init: self.attribute = attribute if it exists or else self.get_attribute
Some driving design factors
boilerplate in functions themselves should remain minimal to non-existent. There's a lot of functions, and any rearchitecting down the line would require all of the boilerplate changed.
Would be nice for systems to be able to just access attributes (res = self.component.resolution) instead of calling method (res = self.component.get_resolution()). If no boilerplate is allowed in the latter, there would never be a way for the actual attribute if it exists to be returned
Should a system be accessing the attributes of a component, and if that component does not have a value for that attribute, can it call a function to get that value?
Consider also the case the component has value, is its ability to recompute the attribute removed? What about conflicting values? I.e. a component is defined with attributes, but the function to compute a particular attribute returns a different value than the one that is defined. How to handle?
Or should every attribute that a system wants to extract from a component/subsystem be accessed with a "get_attribute()"?
How about placing a "if self.attribute exists, return the attribute" instead of computing the value? Or on init: self.attribute = attribute if it exists or else self.get_attribute
Some driving design factors