Details
-
User Story
-
Resolution: Done
-
Not Evaluated
-
None
-
None
-
None
-
QDS Berlin - 2022 Week 35/36, QDS Berlin - 2022 Week 37/38, QDS Berlin - 2022 Week 39/40
Description
In the model there can be invalid states. Mostly because of the removal of elements. Originally my idea was that strong checks would force people to fix their ownership. So if a node is removed all owned model nodes would be checked. But because it is much easier to fix a crash(caused by the exceptions) at the point of the crash a simple isValid() check is used. This is leading to much code clutter. Over time people copied that approach as a new pattern and tested everywhere for invalid nodes. Even for invalid root notes which should not be possible.
So my proposal is to remove the checks in the functions and simple return sensible defaults. So for an invalid node no parents, properties are returned etc..
We even could remove the isValid check to force people to fix their ownership but I think that is too much work.
We could add extra classes like "persistent model nodes" which would remove the invalid model nodes automatically. It would look like a list but would be connected to the view. If the node is removed or a model detached it would handle that case.