MVC or MVP or MVVM
(Model-View-Controller / Model-View-Presenter / Model-View-ViewModel)
(The choice depends on what fits you best and what you want to do)
This way you divide the rules of the application into layers.
In Model , you can create all the major business entities and rules in a WebService in any language or platform and from there make the data available and interact with your page Without a real link between the two. Just a contract from the public interface of the Model for FronEnd.
Advantages of layering
Splitting your application by separating View
from the code you have several advantages:
- Reducing network traffic
- Application Server Load Reduction
- More dynamic and fluid navigation
- Independence between Front End and Back End teams that only need to establish the functions and signatures of the methods that will be exposed
Frameworks
Among these frameworks I can cite:
It is a Model View ViewModel framework that provides Two-Way binding
between the DOM and the ViewModel in javascript
Causes the DOM to refresh when there is an update in the ViewModel and update the ViewModel automatically when there is a change in the DOM
I have some delayed things here, so I finish complementing the answer with the other frameworks and examples
Ember.js is a Javascript framework for client-side web page development based on MVC architecture. It allows you to create SPA (Scalable Single Page Applications), incorporating several features besides self-updating templates based on Handlebars.js
AngularJs is an MVW (Model View Whatever) framework that allows you to use (to be continued ...)