Giter Site home page Giter Site logo

Comments (1)

KunMinX avatar KunMinX commented on May 17, 2024

MVVM 的目标是通过 数据驱动编程 来实现 解耦的、关注点分离的 软件开发模式。
Jetpack MVVM 是在 MVVM 模式的基础上引入了 软件工程安全 以及 用户体验优化 的设计。
因此 Jetpack MVVM 的边界目前仅限于 LifeCycle、LiveData、ViewModel、DataBinding 这四样。(时下的公司比较重视对前三者的正确理解和使用)
·
DataRepository 是数据层的一种组织方式,并不是开发组件,也不存在于 Jetpack 架构组件中,它隐含的**是 通过组合模式,来方便对 本地数据源 或 远程数据源 的灵活组合和对 UI 层的结果输送。为了点到为止地 为读者确立 MVVM 的边界,最佳实践中暂时没有过多地拓展 DataRepository 的代码。
·
此外,DataRepository 层使用到的 Room 等组件,比较简单,确定仅看官方文档就能轻松上手(建议首先通过深度思考 确立 SQL 的场景和用途本身,再上手具体的 Room 使用)。
https://developer.android.google.cn/training/data-storage/room/index.html

from jetpack-mvvm-best-practice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.