ASP.net MVC - how does the view access the model? -


I have seen that in all the MVC diagrams, there is always a connection between the model and the model, indicating that the scene is the model Access to

I just wonder: when does this apply? At the moment, I have to take the parameter from the controller action into the query string, ask the model to get MyObjectViewData, and then return a view to MyObjectViewData, then essentially the controller in my middle.

It seems a logical approach, but it is a notion that models and scenes are not fit in business.

What are the specific circumstances where they interact without controlling

In MVC (On the Web) The view directly contacts the model by providing a special example of an ideal unit, it only works indirectly via the controller on on on the model. In non-web implementation you can use supervisor pattern to register handler with view elements which can use methods in the model which updates models without controlling interaction. ASP.NET MVC and other web-based implementations are loosely coupled with non-web implementations. In my opinion, it is a good thing to be careful about keeping the concerns separate between the controller and the model.

Web implementation should probably be pulled from the model without an indirect connection because of the view because you can not really communicate between the two without the controller. I think someone can argue that a web service can provide this connection, but I'll consider it another form of controller.


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%? -