<> one , Front and rear end separation essence
People often fall into a misunderstanding , This paper attempts to use specific technology to describe the concept of front-end and back-end separation , This is not the answer . When it comes to front and rear end separation SpringBoot + Vue, This and
Not the correct understanding !
What we're asking is ： Why did you solve the problem in this way
The answer is ： How do you do it
Front and rear end separation is ： Software technology and business development to a certain extent , A necessary upgrade in project management , He is a necessity, not an accident ! put in plain language , It is an adjustment of the company's department structure .
Why did this change happen ?
Because the initial software development actually focuses on the back end , Because the page function in the early stage of the Internet is relatively simple , Just show the data , Then provide basic operations ! Therefore, the whole project focuses on the business logic processing in the background . But with the development of business and technology , Front end functions are becoming more and more complex , Become more and more important , At the same time, the front-end technology stack is becoming more and more abundant ! In this way, we encounter more and more problems in development , It is more and more difficult to solve these problems , At this time, we found that the front-end development cannot be scattered in the whole system architecture as before . The front end should also be like the back end , Realize engineering , modularization , systematization .
How to do this ?
Is to set up a special front-end department , Centralize the front-end development originally mixed with back-end programmers , Form a pure front-end Department . Specialized in the research and development of Engineering front-end technology , Iterative upgrading of new technical system , To solve problems in the project , Adapt to the development of Technology . So one sentence summary ：
In order to meet the needs of technology and business development . Front end development needs to be separated from the previous organizational structure with front and rear ends mixed together , Form an independent front-end department and back-end department , This is why the front and rear ends are separated
<> two , Disadvantages of not using front and rear end separation
Front and back end separation is a popular development method at present , Most of the Internet will be developed by separating the front and back ends !
Separation of front end and back end means that the front-end code and back-end code of an application are written separately
conventional Java Web During development ,JSP It is not done by back-end developers alone
Front end development ——>HTML Static page ——> Back end development ——>JSP
The front end will make the page , We need to develop the backend , Just embed the front page into JSP in , Or use something else Thymeleaf The same is true for templates ! You also need to add labels to integrate the data . Because the core is ： How to add the data returned from our backend to the page , Whether it is JSP still Thymeleaf The templates are the same !
If you encounter some problems in the back-end page at this time , We put JSP Send to front-end development , Front end developers don't understand JSP. At this point, the front end is not easy to solve , The back end is not easy to solve . This communication and development efficiency is very low ! The coupling degree of front and rear ends is too high , Development is too cumbersome !
The solution is simple ： It is developed by separating the front and rear ends !
The front end only needs to write the client code independently , The back end only needs to write the server code independently and provide the data interface
Front end pass AJAX Request to access the data interface of the back end , take Model Show to View Medium
Front and back end developers only need to agree on the interface document in advance （URL, parameter , data type …）, Then it can be developed independently
The front end can fake data for testing , There is no need to rely on the back end at all , Finally, the front and rear end integration can be completed
It truly realizes the decoupling of front and rear applications ! Greatly improve development efficiency
Monomer ——> Front end application + back-end applications
Front end application ： Responsible for data display and user interaction
back-end applications ： Be responsible for providing data processing interface
front end HTML——>Ajax——>RestFul Back end data interface
<> three , Illustration of separation of traditional monomer and front and rear ends
<>1. Traditional monomer structure
<>2. Front and rear end separation structure
summary ： Front and back end separation is to split a single application into two independent applications ： Front end application and back-end application , with JSON Format for data interaction