In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what is the method of integrated development of Flutter+FaaS two-terminal protocol". The explanation in this article is simple and clear, easy to learn and understand. Please follow the ideas of Xiaobian and go deep into it slowly to study and learn "what is the method of integrated development of Flutter+FaaS two-terminal protocol" together!
Evolution of R & D Architecture
Let's review the evolution of front-end and back-end R & D architecture with these two questions.
In the early days of PC Internet, there was no concept of front and back end. At this stage, a single business requirement can usually be completed by a developer. The front-end webpage and back-end logic are written in one project. As the business becomes more and more complex, the original developer responsible for front-end research and development has become inefficient. At this stage, with the outbreak of mobile Internet, the server needs to serve with PC, Android, iOS and other front-ends.
There is always a question on the server side: should the server design interfaces for UI or generic services? One solution is to extract a part of the server end to do BFF (Backend For Frontend), as an adaptation layer between the front and back ends, the core is to solve the aggregation and arrangement of data, and re-explore a more reasonable hierarchical cooperation mode.
Server-side writing BFF brings new problems, always packet interfaces do not improve personal capabilities. If BFF can be developed by end-side students to solve this problem, the specific technical solution is also the next question we have to think about.
Cloud integration technology solutions
Serverless consists of BaaS (Backend as a Service) and FaaS (Function as a Service). BaaS mainly includes database storage, message queue and other capabilities. For complex requirements, it is suggested that the server end encapsulate the domain service in BaaS layer for FaaS layer to use. As end-side development, Core focuses on code development at the client and FaaS layers.
At present, the FaaS environment of the company has supported Java, Kotlin, Swift, Dart, Node.js and other languages and frameworks. Idle Fish uses Dart to achieve language integration through Android (Flutter), iOS (Flutter) and FaaS (Dart Runtime), and realizes protocol integration and engineering integration.
Language integration: Android, iOS and FaaS layers are developed using Dart language, realizing the unification of three languages and effectively shielding the language learning cost of FaaS layer.
Protocol integration: communication details are shielded through the integration framework, and the front and back ends have the same State, reducing protocol conversion. When the front-end students call FaaS services, they are as simple as calling local functions.
Engineering integration: The front and back ends can be developed in the same project, and the Dart feature can be used for rapid development and joint debugging through the Hot Reload mechanism.
Single page integration practice
The following takes the integration of idle fish single page as an example, and the integration practice process is carried out through two parts of page rendering and interaction.
Order rendering integration
As can be seen from the left side of the above figure, the client needs to request 5 interfaces on the end side to render this page, process the logic between the rendering interfaces, and convert the Data returned by the interface to ViewModel. After the integration transformation, the original logic on the end side is moved to the FaaS layer, including aggregating 5 domain services, processing business logic, performing field mapping and page layout, and directly obtaining the returned ViewModel refresh page without any rendering and business logic on the end side. Below is the flowchart of cloud integration.
Single page interoperability integration
As can be seen from the right side of the above figure, there are 4 kinds of operations that will change the actual payment. Originally, these operation processing logics are processed on the end side. After the integrated transformation, there is no calculation logic on the end side. The client will request the server for each operation. FaaS will verify whether the red envelope expires, and then return the page data for refreshing.
Integrated R & D Framework
Nexus Framework: Flutter based integrated mobile UI framework.
Logic Engine: Flutter based integrated communication and scheduling framework.
Nexus Server: An all-in-one server framework based on Dart Runtime.
code example
The following is an example of the code for initializing a single page on the client side:
The following figure shows how the FaaS layer handles initialization requests initiated by clients:
Thank you for reading, the above is the content of "Flutter+FaaS two-terminal protocol integrated development method is what", after the study of this article, I believe that everyone has a deeper understanding of Flutter+FaaS two-terminal protocol integrated development method is what this problem is, the specific use situation still needs to be verified by practice. Here is, Xiaobian will push more articles related to knowledge points for everyone, welcome to pay attention!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.