V
V
vasIvas2014-08-29 15:08:32
JavaScript
vasIvas, 2014-08-29 15:08:32

What is the responsibility of the "thin controller" and how does it connect the view to the model?

Starting to study the web, I came across an inverted mvc world. I will not write my vision of mvc (yet), but I will immediately ask you to tell me what is the responsibility of the "thin controller" and how does the view connect with the model?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Solovyov, 2014-08-29
@vasIvas

you file all the logic into services, and in the controller you call only the necessary methods from these services.

B
bromzh, 2014-09-05
@bromzh

But in object-oriented programming, an active MVC model is used, where the model is not only a collection of data access code and a DBMS, but also the entire business logic. It should be noted that a model can encapsulate other models within itself. In turn, the controllers are only elements of the system, whose immediate responsibility is to receive data from the request and transfer them to other elements of the system. Only in this case the controller becomes "thin" and performs exclusively the function of a link (glue layer) between the individual components of the system.

How could this not be seen on Wikipedia?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question