3 ms·
I'm a fan of the following architecture: DB <==> Business Logic <==> API <==> JS Services Layer (common functionality + api handling) <==> JS display logic <==
by jtfairbank 12y ago
I'm a fan of the following architecture:
DB <==> Business Logic <==> API <==> JS Services Layer (common functionality + api handling) <==> JS display logic <==> html/css
It forms a communication pipeline with very distinct layers, as opposed to a backend that mixes business logic with display logic instead of using an API. Many Frameworks implement this paradigm, and its fairly easy to roll by hand.
Model View View-Model works will on the frontend- your JS code can consider anything coming from the API to be a model, the services layer can transform it into the View Model, and the display logic updates the view.