javascript - What do you think about the separation of front-end and back-end?
阿神
阿神 2017-06-28 09:28:43
0
6
749

The backend only provides data, and all other operations are left to the frontend

阿神
阿神

闭关修行中......

reply all(6)
曾经蜡笔没有小新

The backend only provides api, which includes data, as well as the organization and processing of data

The front end is responsible for presenting and retrieving data

Talking about a three-tier structure with front and rear ends separated

If it’s more complicated, node+frontend will be used as the front end,

Node is just a simple express or koa, using http to request java or php server

You will definitely be thinking about what node is used for. Yes, it is a template engine

In the traditional two-tier architecture, the template engine cannot be separated, jsp and java are always in the same project, and the coupling degree is too high

Three-tier structure, node projects are sent to the production environment separately,

Then use node to request remote java or php projects, and node to request other backends are between servers, so there is no cross-domain issue

In this way, the front-end is only responsible for using node to adjust the API and the front-end template engine to render the page.

A project can get data from multiple java servers or php servers separately

For example, the formats obtained by 20 java interfaces, 20 php interfaces, and node are all based on documents

学习ing

All connections between the front and back ends go through API

typecho

The backend only provides data, and all other operations are left to the frontend. This understanding is basically correct.

学霸

http://blog.jobbole.com/65513/

伊谢尔伦

You understand it right, let me put it briefly
When it was not separated before, the template was in the backend, and js and css were in the frontend, so every time you modify the style and function, you need to change the backend project
After separation, the backend only provides the API interface , the front-end handles templates and styles
Then the front-end uses nodejs for separation. Usually nodejs is a very thin layer in this case and is only responsible for simple functions such as routing, interface forwarding, merging, and cleaning

我想大声告诉你

Front-end: responsible for the View and Controller layers, back-end: only responsible for the Model layer, business processing/data, etc.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template