当前位置:网站首页>Swiftui development experience: data layer of application design for offline priority
Swiftui development experience: data layer of application design for offline priority
2022-06-26 10:31:00 【Knowledge fatness】
Internet age , Why do I need to launch offline applications ? Let's discuss its importance and implementation through an example .
background
well , Let's start with the concept of offline priority applications .
Offline priority applications are architected in such a way that even if your Internet is in poor condition or has no Internet at all , They can also continue to work .
Have you ever thought about it Evernote Wait for note application or Whatsapp Wait for chat apps to continue working without the Internet ? You can not only use existing data , You can also send messages or add comments , It synchronizes when the Internet is available .
It's not magic ! This is how these applications are designed .
Offline priority applications are very enjoyable to use , And it will certainly make users happy , Because when they want to take action , They will never be stopped by the Internet , Especially in a world where everyone has very limited time !
Now we understand the concept and its importance , Let's see how to start creating these types of applications !
How to build the first offline application
There are many ways to create offline first applications , But ideally , In my submission UI You shouldn't care about it , The logic should be completely encapsulated in the data layer .
today , We will explore ways in which the data layer is fully responsible for creating offline first experiences .

Using this method , The data layer basically provides an interface with UI Repository for tier interaction . The repository then handles both local and remote storage .
To make a long story short , There are... In the data layer 3 A component :
- Repository — towards UI The layer provides data obtained from local storage . It also notifies remote storage when a refresh is required .
- The local store
边栏推荐
- 什么是僵尸网络
- 2. 合并两个有序数组
- Use of exec series functions (EXECL, execlp, execle, execv, execvp)
- Global and Chinese market of aluminum sunshade systems 2022-2028: Research Report on technology, participants, trends, market size and share
- Flutter与原生通信(上)
- Blog post index summary --c #
- 工程数学概率论统计简明教程第二版复习大纲
- Luogu 1146 coin flip
- The fourteenth MySQL operation - e-mall project
- 创建对象的时候堆内存的分配
猜你喜欢

全渠道、多场景、跨平台,App如何借助数据分析渠道流量

Differences between JVM, Dalvik and art

String constant pool, class constant pool, and runtime constant pool

A list of common methods for customizing paint and canvas of view

Under the double reduction, the amount of online education has plummeted. Share 12 interesting uses of webrtc

String constant pool, class constant pool, and runtime constant pool

量化投资学习——经典书籍介绍

Cmake / set command

MySQL第七次作业-更新数据

MySQL第十二次作业-存储过程的应用
随机推荐
Global and Chinese market of electronic pet door 2022-2028: Research Report on technology, participants, trends, market size and share
JVM的符号引用和直接引用是什么
cmake / set 命令
Basic string operations in C
Reshape a two-dimensional array with 3 rows and 3 columns to find the sum of the diagonals
What are the symbolic and direct references of the JVM
904. fruit baskets
Express (I) - easy to get started
Global and Chinese markets of children's electronic thermometers 2022-2028: Research Report on technology, participants, trends, market size and share
MySQL第十三次作业-事务管理
Blog article index summary -- Software Engineering
Introduction to libmagic
Establishment of smart dialogue platform for wechat official account
MySQL 8th job
Record the handling of oom problems caused by too many threads at one time
36 qtextedit control input multiline text
Little red book - Notes inspiration - project summary
Leetcode intermediate node of linked list
June training (the 26th day) - collective search
Global and Chinese market of aluminum sunshade systems 2022-2028: Research Report on technology, participants, trends, market size and share