当前位置:网站首页>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
边栏推荐
- String constant pool, class constant pool, and runtime constant pool
- 2. 合并两个有序数组
- String constant pool, class constant pool, and runtime constant pool
- 字符串常量池、class常量池和运行时常量池
- Win10安装tensorflow-quantum过程详解
- Quantitative investment learning - Introduction to classic books
- 【Leetcode】76. Minimum covering substring
- Global and Chinese market for change and configuration management software 2022-2028: Research Report on technology, participants, trends, market size and share
- What should the preview do?
- CentOS安装Redis多主多从集群
猜你喜欢

Some problems to be considered when designing technical implementation scheme

The fourteenth MySQL operation - e-mall project

Hcia-dhcp experiment

Little red book - Summary of internal sales spike project

Write data to local file

See how I store integer data in the map < string, string > set

基础-MySQL

The first batch of 12 enterprises settled in! Opening of the first time-honored product counter in Guangzhou

Appium automation test foundation - mobile end test environment construction (II)

MySQL第七次作业-更新数据
随机推荐
Under the double reduction, the amount of online education has plummeted. Share 12 interesting uses of webrtc
MySQL第九次作业-连接查询&子查询
Global and Chinese market of recycled paper 2022-2028: Research Report on technology, participants, trends, market size and share
118. Yanghui triangle
Quantitative investment learning - Introduction to classic books
CentOS安装Redis多主多从集群
Index summary of blog articles -- Industrial Internet
String constant pool, class constant pool, and runtime constant pool
Establishment of smart dialogue platform for wechat official account
MySQL Chapter 4 Summary
Today's headline adaptation scheme code
二叉树常见面试题
8-图文打造LeeCode算法宝典-最小栈与LRU缓存机制算法题解
首批12家企业入驻!广州首个集中展销老字号产品专柜开张
Global and Chinese market of cryogenic bulk tanks 2022-2028: Research Report on technology, participants, trends, market size and share
RDB持久化验证测试
Detailed explanation of winsorflow quantum installation process
String类intern()方法和字符串常量池
【Leetcode】76. 最小覆盖子串
exec系列函数(execl、execlp、execle、execv、execvp)使用