design patterns - Model-View-Controller: when should changes to the view be determined by the controller? -


Model-View-Controller allows two types of changes in view:

  1. Whenever the model changes, the scene receives a change notification so that it can update its visual representation accordingly.
  2. The controller is given direct access to the visual API for the purposes of "visual selection".

What exactly is "view view", and in what situation can the controller make changes based on their own changes on the scene rather than changing the scene?

Here is an article that you can find useful.

A MVC flow in which the authors send the information to the controller (not in traditional form), to the model. Therefore, the controller mediates the flow of data between models and visual objects in both directions. As he said

This design helps to fully display the model from this view. In this case, the controller can control model properties, which is expected to find in one or more models registered with the controller. Apart from this, it can also provide methods which affect the change of property for one or more views of the model that are registered with it

... which is your See the answer to the question selection. It is basically just that the application contains a series of sequences that are relevant or updated according to a change in the model.

and the controller will decide which views should be updated and collaborated to work (information from one view is not enough)


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -