W
W
Waldemar10102019-12-29 16:32:24
JavaScript
Waldemar1010, 2019-12-29 16:32:24

How to implement MVC and MVP correctly?

Hello everyone, I started learning about MV* patterns and got a little confused that some implement MVC so that the controller shares the relationship between View and Model. That is, the Model does not update the View, although the wiki and other sources say that in MVC - the Controller processes the input, transmits the Model changes, and the Model, in turn, changes the View, that is, the View is the output.
5e08a861c2498882174654.png
But reading articles where a specific implementation of MVC in Javascript, everything happens a little differently:
1) https://www.taniarascia.com/javascript-mvc-todo-app/
2) https://habr.com/ru/company/ruvds/ blog/333856/
5e08a91dd6c3a268540020.jpeg

The model never touches the view. The view never touches the model. The controller connects them.

That is, it completely isolates the Model from View, and again, if you follow the wiki, then such a pattern is no longer MVC, but MVP.
Can you tell me how is it correct? Is my understanding of MVC and MVP correct? I concluded that those two articles were written with errors because they implement a completely different pattern.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Romashkan, 2019-12-29
@Waldemar1010

You correctly understood that in MVC the controller is not a link between View and Model, what is called MVC on the web is actually MVA - https://en.wikipedia.org/wiki/Model%E2%80%93view%E ... .
MVC is one of those terms that a lot of people talk about but that almost no one understands, alas. In the articles cited from Habr, concepts are simply replaced
. Right there on the toaster, from the old one, I advise a couple of suitable descriptions - one and two . Basically everything you need to know right now.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question