Understanding of java front-end separation

Understanding of java front-end separation

So far, as a java back-end developer, I,

During the work, it is nothing more than ui design page, front-end development html, and then hand over the finished page to me, I am responsible for the back-end logic and html page rendering.

A good back-end developer has started the front-end work inexplicably, which is very exhausting.

I have never understood what the separation of front and back ends is. I read a blog today and said it really well.

Migraine Yang  sees it right, it's in place.

Previously, a company used jsp, and the efficiency was really low.

jsp must be run in a web server that supports java

4. The first time a JSP is requested, it must be compiled into a servlet in the web server. The first time it runs, it will be slower.

5. Every time a JSP is requested is to access the html page output by the servlet and then use the output stream. The efficiency is not as high as using html directly (every time, dear~).

6. There are many tags and expressions in jsp, front-end engineers will be stretched when modifying the page, and they will encounter many pain points.

7. If there is a lot of content in the jsp, the page response will be very slow because it is loaded synchronously.
Web server: generally refers to servers such as nginx and apache, they generally can only parse static resources.
Application server: Generally, servers like tomcat, jetty, resin can parse dynamic resources as well as static resources, but the ability to parse static resources is not as good as web servers.
Generally, only the web server can be accessed from the external network, and the application server can only be accessed from the internal network.
For the back-end java engineer:
Focus on java foundation, design pattern, jvm principle, spring+springmvc principle and source code, linux, mysql transaction isolation and lock mechanism, mongodb, http/tcp, multithreading, distributed architecture (dubbo, dubbox, spring cloud), Elastic computing architecture, microservice architecture (springboot+zookeeper+docker+jenkins), java performance optimization, and related project management, etc.
The back-end pursuit is: three highs (high concurrency, high availability, high performance), security, storage, business, etc.

For front-end engineers:
Focus on html5, css3, jquery, angularjs, bootstrap, reactjs, vuejs, webpack, less/sass, gulp, nodejs, Google V8 engine, javascript multithreading, modularization, aspect-oriented programming, design patterns, browser compatibility , Performance optimization and so on.
The front end pursues: page performance, smooth speed, compatibility, user experience, and so on.

Before the lecturer said that to be a full-fledged programmer, the front and back ends are taken together. I found that getting started is easy, but it is really difficult to go deep

As the saying goes, there is a specialization in the art industry, if a person knows everything, then he is not good at anything after all.
Development model

The old way was:
1. Product experience/leadership/customer requests
2. UI design drawing
3. Front-end engineers make html pages
4. The back-end engineer sets the html page into a jsp page (the front-end and back-end are strongly dependent, the back-end must wait for the front-end html to be ready to set the jsp. If the html changes, it will be more painful and the development efficiency is low)
5. Problems with integration
6. Front end rework
7. Back-end rework
8. Secondary integration
9. Successful integration
10. Delivery



The new way is:
1. Product experience/leadership/customer requests
2. UI design drawing
3. Front-end and back-end agreed interface & data & parameters
4. Front-end and back-end parallel development (no strong dependence, front-end and back-end development can be done in parallel. If the requirements change, as long as the interface & parameters remain unchanged, there is no need to modify the code on both sides, and the development efficiency is high)
5. Front-end and back-end integration
6. Front-end page adjustment
7. Successful integration
8. Delivery
Request method

The old way was:
1. Client request
2. The server-side servlet or controller receives the request (the back-end controls the routing and rendering of the page, and the major part of the entire project development is in the back-end)
3. Call service, dao code to complete business logic
4. Return to jsp
5.jsp shows some dynamic code



The new way is:
1. The browser sends a request
2. Directly reach the html page (front-end control routing and rendering page, the weight of the entire project development is moved forward)
3. The html page is responsible for calling the server interface to generate data (via ajax, etc., the background returns json format data, json data format replaces xml because of its simplicity and efficiency)
4. Fill in html, show dynamic effects, parse and manipulate DOM on the page.
(If you are interested in children's shoes, you can visit large websites such as Alibaba, and then click F12 to monitor how you refresh the page once, how his http is played, most of them request background data separately
Use json to transmit data, instead of a large and complete http request to return the entire page including dynamic + static)
Reference: https://cloud.tencent.com/developer/article/1335858 Understanding of java front-end and back-end separation-Cloud + Community-Tencent Cloud