- 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.
推薦閱讀
- Java程序設計(慕課版)
- 零基礎PHP學習筆記
- NLTK基礎教程:用NLTK和Python庫構建機器學習應用
- 我的第一本算法書
- Flux Architecture
- 正則表達式經典實例(第2版)
- Mastering Linux Network Administration
- Unity UI Cookbook
- Python自然語言理解:自然語言理解系統開發與應用實戰
- Julia High Performance(Second Edition)
- 高性能PHP 7
- Mastering Object:Oriented Python(Second Edition)
- Python Business Intelligence Cookbook
- JavaWeb入門經典
- IBM Cognos TM1 Cookbook