We know that MVC is a standard of software architecture (design pattern) which makes a separation of:
- View (UI),
- Template (Business Rules),
- Controller that communicates between the two.
Of course, MVC can be adopted as a template to create your own architectural style to solve a more specific problem.
Example Project 1:
Directories:
> Model
> Controller
> View
> UX
Execution Diagram:
View → UX → Controller → Model
User enters with data of register in View, when sending is passed to UX jQuery that is done the validation of information from the client side and sent to the controller, the controller only redirects to the model that does the server side validations .
Sample Project 2:
Directories:
> Model
> Controller
> View
Execution Diagram:
View → Controller → Model
User enters with data of register in View, when sending is passed to Controller jQuery that the validation of the information of the client side is made and sent the model that does the validations of the server side.
When I asked why this separation took place the answers were like this:
Project 1:
jQuery is part of the user interaction, so it is present in the view.
Project 2:
jQuery performs all the interaction but also communicates with the model through ajax.
So my question is, where does jQuery go? And what specific tasks should it perform in this architecture?