Reputation: 913
I have read this tutorial: http://www.tutorialspoint.com/design_pattern/mvc_pattern.htm
I have found it very understandable, but the structure of this Model-View-Controller is different from other examples.
In this tutorial, Controller is using data from Model (Student) and is updating View (StudentView) with new data.
But according the scheme on this picture, Controller is manipulating the Model and Model is updating View. According to this scheme Controller has link to Model, and Model has link to View (or I am wrong?).
This difference is confusing me. Can anyone help me and explain me the correct structure of MVC pattern.
Upvotes: 0
Views: 90
Reputation: 11
There is no one MVC pattern as each language or framework will define it slightly different. We know Controller encapsulate the business logic, process the user request, and send it to the Model. The Model contains the data and may contains some logic to validate itself or notify subscribers of change. The View formats the data, responds to notifies from the model or controller, and presents it to the user. Typically MVC refers to the patterns Observer, Composite, and Strategy and will often employ Factory, Decorator, and other patterns to achieve MVC. (Design Patterns Elements of Reusable Object-Orient Software)
As to the diagram, I would say it is mostly accurate. Just a poor choice of wording. Update vs Notify
Upvotes: 1