Update of detached
How to control, when to run update definitions? Especially during construction of the AST, the notification might be a) unwanted, or b) not possible due to the incomplete tree.
Possible solutions include:
-
Add a method in the parent
set${TOKEN}(${TYPE} value, boolean triggerUpdate)
which only triggers the update when the 2nd parameter is set totrue
. -
Add a method in the parent
set${TOKEN}_NoUpdate(${TYPE} value)
which never triggers the update. -
Add methods in the parent to set and unset a state of "in-construction", where no triggers are send if the generated setters are invoked.
-
Add methods in the root of the model to set and unset a state of "in-construction", where no triggers are send if any generated setters in this subtree are invoked.
-
Invoke the methods anyway and ignore/log any exceptions/errors. Not advisable, as errors might be lost, or unnecessarily thrown in the first place.