Home >Common Problem >Quickly understand the essence of front-end and back-end separation (with architecture diagram)
People often fall into a misunderstanding and try to describe it with specific technologies What is the concept of front-end and back-end separation? This is not the answer. For example, when it comes to separation of front-end and back-end, it means Laravel Vue. This is not a completely correct understanding! We asked: Why do you solve the problem in this way
The answer is: How do you do it specificallyYes: When software technology and business develop to a certain extent, an upgrade must be carried out in project management work. It is a necessity and not an accident! To put it bluntly, it is an adjustment to the company's departmental structure. [Related recommendations: webfrontend]Why did this change happen?
Because the initial software development actually focused on the back-end, because the page functions in the early days of the Internet were relatively simple. They only needed to display data and then provide basic operations! Therefore, the entire project focuses on the background business logic processing. However, with the development of business and technology, front-end functions are becoming more and more complex and important, and at the same time, the front-end technology stack is becoming more and more abundant! In this way, we encountered more and more problems during development, and it became more and more difficult to solve these problems. At this time, we found that front-end development could not be scattered throughout the system architecture as before. The front-end should also be engineered, modularized, and systematized like the back-end.How to do this?is to set up a dedicated front-end department to centralize the front-end development that was originally mixed with back-end programmers to form a pure front-end department. Specialize in research and development of engineering front-end technology and iteratively upgrade new technology systems to solve problems in projects and adapt to technology development. So in one sentence:
In order to adapt to the needs of technology and business development. Front-end development needs to be separated from the previous organizational structure where the front-end and back-end were mixed together to form independent front-end and back-end departments. This is the reason for the separation of front-end and back-end.
2. Do not use front-end and back-end Disadvantages of separation
The front-end code and back-end code of an application are written separately
Independentfront-end and back-end separationCompleted Front-end development——>HTML static page——>Back-end development The front-end will make the page. If we need to develop the back-end, we will embed the front-end page into The same applies to View templates or using other templates! Tags also need to be added to integrate the data. Because the core is: how to add the data returned by our backend to the page
The solution is very simple: just use the
If we encounter some problems in the backend page at this time, we send the template file to the front-end development, and the front-end developer cannot understand the template. At this time, the front end is not easy to solve, and the back end is not easy to solve either. This communication and development efficiency is very low! The front-end and back-end coupling is too high, making development too troublesome!
method to develop! The front-end only needs to write the client code independently, and the back-end only needs to write the server-side code independently to provide the data interface. The front-end accesses the back-end data interface through AJAX requests and displays the Model in the View.
Front-end and back-end developers only need to agree on the interface documents (URL, parameters, data types...) in advance, and then develop them independently
, truly realizing the decoupling of front-end and back-end applications! Greatly improve development efficiency
Front-end application: Responsible for data display and user interactionBack-end application: Responsible for providing data processing interface
3. Front-end and back-end separation architecture diagram
Front-end HTML——>Ajax——>RestFul back-end data interface
Summary :
The above is the detailed content of Quickly understand the essence of front-end and back-end separation (with architecture diagram). For more information, please follow other related articles on the PHP Chinese website!