0

can anybody tell me, why communicates the model direct with the view in the MVC pattern, and why not just throught the controller?

http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller

Aaaaaaaa
  • 2,015
  • 3
  • 22
  • 40
  • Where exactly does the model communicate with the view in this WP article? –  Apr 05 '11 at 11:54

2 Answers2

6

Sometimes it is too costly to use Controller for simple View/Model communication.

enter image description here

If your view just shows raw data without any operation (filtration, visualization, modification ...) it is easy to forget about Controller.

But this behavior is so abuse-able sometimes it kills all of the advantages of MVC.

And this where MVP comes in:

MVP (Model-View-Presenter) cuts the connection between model and view and every thing pass through man-in-the-middle (Presenter).

enter image description here

Kerem Baydoğan
  • 10,475
  • 1
  • 43
  • 50
0

The views know of the model and will interact with the model.

  • If a button is clicked an action message might be sent to a model object in order to get something done.
  • If a new value is typed into an entry field an update message might be sent to a model object in order to give it its new value.
  • If a value is needed for a display an enquiry message might be sent to a model object in order to get a value.
Jason Sturges
  • 15,855
  • 14
  • 59
  • 80