当前位置:网站首页>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
边栏推荐
- Pytest configuration file
- MySQL seventh job - update data
- 【無標題】
- Omni channel, multi scenario and cross platform, how does app analyze channel traffic with data
- 小笔记-简单但够用系列_KVM快速入门
- The IE mode tab of Microsoft edge browser is stuck, which has been fixed by rolling back the update
- Redis中执行Lua脚本
- Constraintlayout control uses full Raiders
- P1296 whispers of cows (quick row + binary search)
- Full introduction to flexboxlayout (Google official flexible implementation of flow layout control)
猜你喜欢
Win10安装tensorflow-quantum过程详解
3行3列整形二维数组,求对角之和
Reshape a two-dimensional array with 3 rows and 3 columns to find the sum of the diagonals
Call API interface to generate QR code of wechat applet with different colors
exec系列函数(execl、execlp、execle、execv、execvp)使用
C中字符串基本操作
MySQL第八次作业
Differences between JVM, Dalvik and art
Allocation de mémoire tas lors de la création d'objets
Servlet learning notes II
随机推荐
Quantitative investment learning - Introduction to classic books
Renesas electronics launched a complete intelligent sensor solution for Internet of things applications
When will JVM garbage collection enter the older generation
cmake / set 命令
Little red book - Summary of internal sales spike project
MySQL Chapter 5 Summary
【Leetcode】76. Minimum covering substring
Introduction to libmagic
Under the double reduction, the amount of online education has plummeted. Share 12 interesting uses of webrtc
String class intern() method and string constant pool
Procedure Call Standard
Jar version conflict resolution
Cmake / set command
Dialog centered
2. 合并两个有序数组
Servlet learning notes II
磁带库简单记录1
MySQL第十一作业-视图的应用
MySQL第六次作业-查询数据-多条件
Win10安装tensorflow-quantum过程详解