- Hands-On RESTful Web Services with Go
- Naren Yellavula
- 177字
- 2021-06-24 17:04:23
Old and new methods of data flow in SPA
In the traditional flow of serving requests, the order looks like this:
- The client requests a web page from the server
- The server authenticates and returns a rendered response
- Every rendered response is in HTML with embedded data
With SPAs, however, the flow is quite different:
- Request the HTML templates with the browser in one single go
- Then, query the JSON REST API to fill a model (the data object)
- Adjust the UI according to the data in the model (in JSON)
- From the browser, push back the changes to the server via an API call
In this way, communication happens only in the form of the REST API. The client takes care of logically representing the data. This causes systems to move from Response-Oriented Architecture (ROA) to Service-Oriented Architecture (SOA). Take a look at the following diagram:
SPAs reduce bandwidth usage and improve site performance. SPAs are a major boost for API-centric server development because now a server can satisfy requirements for both browser and API clients.
推薦閱讀
- DB2 V9權(quán)威指南
- Visual C++程序設(shè)計(jì)教程
- PaaS程序設(shè)計(jì)
- Ext JS Data-driven Application Design
- React Native Cookbook
- Java程序員面試算法寶典
- Mastering Apache Maven 3
- 軟件測(cè)試技術(shù)指南
- R Deep Learning Cookbook
- Visual Basic程序設(shè)計(jì)
- Access 2010數(shù)據(jù)庫(kù)應(yīng)用技術(shù)實(shí)驗(yàn)指導(dǎo)與習(xí)題選解(第2版)
- Orchestrating Docker
- Exploring SE for Android
- 寫給大家看的Midjourney設(shè)計(jì)書
- Learning Shiny