MVC: where to store and create views?

In large applications a lot of different ideas how to keep them? Create a separate class of MainView, which will store references to all the views? Or store each reference separately in the controller?

The same question about the model
July 8th 19 at 16:25
2 answers
July 8th 19 at 16:27
We are now about what is MVC? a lot of them are different. From your question it is for example possible to draw a conclusion about the two options.

Create a separate class of MainView, which will store references to all the views?


It reminds MVC 1979 release. In this case, the controllers do nothing but handle user input. And all with regard to the representation involved in the actual View. The view here we have an active, it has a bunch of logic and it so happens that this logic even more than in the model. In our example it will be the same MainView which will work directly with the model and pick the desired state from her and myself to update for changes (or ButtonView depends on what we want to give you an idea. Description MVC does not limit how many you can have those things on screen).

Or store each reference separately in the controller?


It's more like a mediating controller MVC. This approach was designed to remove the dependence of the view from the model. In fact, the view becomes passive. Now the controller decides when to update and how to dendrite.

So decide what you need. I suspect that all the same the second because the first one is not actively using it for 20 years.
July 8th 19 at 16:29
You mmm...

In short. See how it works in other MVC frameworks. For example in laravel
I suspect that the author about a few other things MVC. - Allene_Crona78 commented on July 8th 19 at 16:32

Find more questions by tags MVCOOPProgramming