I've been reading about MVP, specifically Supervising Controller. One thing I'm having difficulty wrapping my head around is how the View interacts with the Model.
It was my understanding that the Presenter should update the Model and that the View reads from the Model. The Presenter can also update the view through an interface. Martin Fowler's article on this seems to show just that (http://martinfowler.com/eaaDev/SupervisingPresenter.html).
However, other articles/blogs show the view updating the model directly (https://blogs.msdn.microsoft.com/erwinvandervalk/2009/08/14/the-difference-between-model-view-viewmodel-and-other-separated-presentation-patterns/).
I know these are just patterns so there will be different implementations, but the view updating the model seems like it is doing much more than it should.
Say for instance I had a person class that contained a name and phone number. The view can display this name and number and a submit button to change the name and number of the person. When the submit button is clicked I would expect the updating to be handled in the Presenter not the View. However, the article I referenced proposes that the view can directly update the model.
So, should the view ever update the model? Or should that only be handled by the Presenter?
EDIT:
Code from the MSDN article:
public class PersonalDataView : UserControl, IPersonalDataView
{
protected TextBox _firstNameTextBox;
public void SetPersonalData(PersonalData data)
{
_firstNameTextBox.Value = data.FirstName;
}
public void UpdatePersonalData(PersonalData data)
{
data.FirstName = _firstNameTextBox.Value;
}
}