4
We know that MVC is a software architecture standard (Pattern design) which makes a separation of:
- Vision (User interface),
- Template (Business rules),
- Controller that performs communication between the two.
Of course, MVC can be adopted as a template to create your own architectural style to solve some more specific problem.
Example Project 1:
Directories :
> Model
> Controller
> View
> UX
Diagram of Execution:
View UX Controller Model
User enters registration data in the View, when sending is passed to jQuery UX which is done the validation of client-side information and sent to the controller, the controller just redirects to the model that makes the server-side validations.
Example Project 2:
Directories :
> Model
> Controller
> View
Diagram of Execution:
View Controller Model
User enters registration data in View, when sending is passed to jQuery Controller that is made the validation of client side information and sent the model that makes the server side validations.
When I questioned why to carry out this separation 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 certain tasks he must accomplish in this architecture?
it is not impossible, but you will have much more work than if you try to use a framework that has been developed for this purpose. Try angular or Ember ...
– pmargreff
UX = User Experience? Why would a directory have that name? Look I think this answer might help http://answall.com/a/94525/3635
– Guilherme Nascimento
@Guilhermenascimento When you take a project in progress and try to understand why things, this for me is an Alternative Architectural Technical Resource alias Gambiarra.
– Gabriel Rodrigues
I didn’t understand if you meant that the MVC is the gambiarra or something else, but you didn’t mention in the question that it was an ongoing project. As soon as you have time read at least the answer http://answall.com/a/94525/3635 (at least the part where this writing "Javascript and PHP Frameworks"), there I explained the separation and is valid for several environments independent of the server-side language, now if it did not serve you is because your project is not web and if it is not web you must specify in the question, I hope you understand the suggestions =)
– Guilherme Nascimento
One thing, as I said UX means "user experience" maybe what you wanted to write is UI (user interface).
– Guilherme Nascimento