Attribute Merging
Thursday, October 10, 2024
When a definition is created from a base, it can override the values of base attributes. It can also introduce new states.
Attribute Finalization
Once definition inheritance has been resolved, attribute merging can be handled. The following are the rules for finalization:
Maintaining Merged Attributes
Merged attributes need to be maintained to ensure that they stay valid. If something changes in the base attribute, it needs to reflect in the derived attribute. This can be done either by using pointers/references when storing base data in derived attributes, or by creating functionality that updates base data in derived attributes. The former is the most ideal option since updates would be passive.
Does Merge Order Matter?
Consider three definitions: D1, D2, and D3.
D1 does not inherit anything.
D2 inherits D1, and D3 inherits D2.
They all have a 'Fill' attribute.
The reason this matters is because the situation is different depending on whether or not any work has to done. For instance, if all of the definitions' Fill attributes define a value/link, then the base attribute's would simply be ignored, and everything would work fine. However, if, for example, D2 and D3 do not define values/links, then does it matter whether D3 is merged first?