| Author here. > "When this field changes, I want to update this other field". That's the problem MVC solves, and that not just a vast majority of so-called MVC frameworks (that are nothing of the sort) get fundamentally wrong, but also a lot of people talking about MVC, in particular those who want to "fix" this non-problem of MVC (see: React). In MVC, fields never update other fields. The model also doesn't update any fields. 1. UI events update the model, and only the model 2. The model notifies the UI that it has been updated, and the UI is now inconsistent. It does not initiate an actual update, nor does send data to the UI. 3. The UI fixes the inconsistency by updating itself from the model. This can be a full update, or it can do something more clever to only update parts it knows have changed. This may be in response to an update notification or not. No update loops. No inconsistencies (well except the temporary ones until the UI has updated itself, but those are part of the deal). Solved in the 70s. I wrote about this here: Model Widget Controller (MWC) aka: Apple "MVC" is not MVC https://blog.metaobject.com/2015/04/model-widget-controller-... And here: Blackbird: A reference architecture for local-first connected mobile apps https://blog.metaobject.com/2022/06/blackbird-simple-referen... |
In a declarative framework, while it is still technically possible, it is very rare. The current app I'm working on is one of the largest front-end apps I've worked on (multiple years of dev). We've had a single infinite loop issue reported that was trivial to fix. We have very junior UI devs compared to teams I've worked on in the past, yet our UI defect rate is incredibly low.