Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端架构分层思考 #21

Open
Jarweb opened this issue Sep 5, 2020 · 0 comments
Open

前端架构分层思考 #21

Jarweb opened this issue Sep 5, 2020 · 0 comments

Comments

@Jarweb
Copy link
Owner

Jarweb commented Sep 5, 2020

前端架构分层思考

image-20200905115749168

  • 请求通信层
    • 理解:把服务端比作是数据库,那请求通信层就是数据库驱动。请求层提供相关的通用的 api,通过通用 api 来封装请求的接口。
    • 功能:http 规范、接口请求、缓存、sw、轮训、并串行、超时、取消、分页、错误处理 ...
  • 存储层
    • 数据实体:与服务端的一致
    • 持久化同步:同步到本地持久化存储
  • 模型层
    • 增删改查:对实体进行操作的 action,可复用
  • 视图控制层
    • 与视图一一对应,处理副作用、业务逻辑、接口通信、错误监听等。
    • 无需考虑复用
  • 视图层
    • 保持简单
  • 应用控制层
    • 应用生命周期
    • 应用配置
    • 插件配置
  • 通用模块
    • 组件库
    • hook 库
    • 函数库
    • 插件库
    • 中间件库
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant