Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to cooperate with the back-end Development of web Front-end

2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "web front-end how to cooperate with back-end development", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "web front-end how to cooperate with back-end development" this article.

Why do the front and rear ends be separated?

In the beginning, web applications only needed back-end development engineers, and the front-end work was also developed by the back-end. Because the aesthetic requirements of web applications are not so high at the beginning, and many dynamic pages are used at this time (each request server will dynamically generate a page), there is no front and back end at that time, only the back end is struggling to do development. Later, customers gradually asked for a better-looking page, and then the front and back end appeared. Take java as an example, you can do back-end development from the very beginning with servlet (directly using servlet to output a stream of HTML files). But in order to reduce code coupling (using the MVC model), JSP (a technique for dynamically generating HTML, which allows HTML to be generated in JSP, servlet no longer handles page generation, only focuses on logic and data processing). At this time, the back-end can separately put forward the page development to the front-end development, at this stage, because JSP also has to know a certain java, so there is a language called EL (used in JSP, it is simpler than java, accurately speaking, it should be called an expression, and EL expressions enable the front-end to obtain server data without mastering java). The front end should also take into account the beauty of the page while developing the page, so the requirements for CSS have also been raised. After that, JSON and AJAX completely separated the front and rear ends. The front-end only needs to develop static pages, then use AJAX to exchange data with the back-end, and then take the data returned from the back-end to the front-end for rendering, which can achieve the effect of modern Web applications. Since then, the front end is only responsible for the development of the presentation page, some simple logic and data interaction with the back end, and the back end is only responsible for passing data and some key services to the front end. This kind of development mode makes the coupling of the whole web application more loose (the front end can be developed with static json instead of dynamic json, and the back end only needs to test the output json).

How do the front and rear ends interact?

As described above, they can exchange data through json, the front end sends and receives json through AJAX, obtains data through json parsing, and the back end uses related technologies (both java and python have special packets for parsing and sending json, for example, java has net.sf.json packets).

How does the front end cooperate with the back end development

There are usually two ways. One is the front end specifies the interface, and the back end is responsible for the implementation of the interface. Since the data presentation processing is implemented by the front end, the front end can require the back end to be given a json of the corresponding format. Another way is to agree on the interface definition together with the front and back end. Because the front end knows little about the back end, if only the front end defines the interface, the interface will be very confusing. The front end and the back end agree on the interface definition together, and the back end can encapsulate the interface during development, making the back end development easier.

The above is all the contents of the article "how the web front-end works with the back-end development". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report