4 ms·
I am super bad with terminology so I'll apologize beforehand. I've found that a good way to avoid this ownership conflict in OO is to categorically prohibit an
by Strs2FillMyDrms 5y ago
I am super bad with terminology so I'll apologize beforehand.
I've found that a good way to avoid this ownership conflict in OO is to categorically prohibit any public accessors to _inherited_ variables, be it at construction phase or later, be it passively (via setters) or actively (via observers).
And there should be only ONE provider of said value, also I've found is sometimes better to have a hot spot where all nodes converge and use it as a nursing node, and JUST THEN, fork this nursing node into every let's say "logic gate requirement" node (with a cached state each).
This is a good approach IMO as long as these smaller nodes are required by more than 2 observers, if not, then a simple specialized observer is the way to go.
- manmal 5y agoCan this be summarized as „Composition > Inheritance“?