Who is responsible for the next view?

In the archetypal MVC architecture, where is the logic that determines which view will be displayed next?

An assumption is some kind of application with several views (windows) that may or may not appear at different times, depending on the user's actions. For example, sometimes the application may require the user to fill out a form with additional data, in other cases this may not be the case. Is it the responsibility of dispatchers to ask that a view become visible?

Am I thinking about it wrong? Maybe the controller determines which other controller should take control, and the view is simply updated depending on which controller is active?

I'm confused.

+3
source share
3 answers

The controller is the boss in the MVC pattern. He is responsible for delegating the most minimal work;).

A request comes in and the boss looks at him and thinks: "Hmm ... there is a lot of work. I need to get some data from my database. Fortunately, I have subordinates! Hey model, come here. I need you to leave and got all the information from DAL. "

Think of the model as a developer. Whether all the hard work, dirty hands and without a model, the whole system collapses. It shuts down and runs all the business and domain logic. He then returns to the boss and hands in all his hard work. "Here you go gov."

. - . , , . ( , !). . , , . , , , , . , .

MVC. , , , (ViewModels).

. , , , . , , . , , .

+3

. . ( ). , , .

0

, , - Workflow Application Controller.

http://martinfowler.com/eaaCatalog/applicationController.html

, . .

, , "", . , , .

, . , .

switch, , , , - :

Spring - http://www.springsource.org/spring-web-flow

Windows Workflow Foundation http://msdn.microsoft.com/en-us/netframework/aa663328

0
source

Source: https://habr.com/ru/post/1764494/


All Articles