Giter VIP home page Giter VIP logo

jetpack-mvvm-scaffold's Introduction

《重学安卓》付费读者加微信进群:myatejx

 

公告:

刚刚就本项目 "被卖课" 一事,在掘金发表了一期专访 《开源项目被人拿去做课程卖了 1000 多万是什么体验》

本项目系我为了方便开发者们 无痛理解 Google 开源的 Jetpack MVVM 中每个架构组件的 存在缘由、职责边界,而 精心设计的一个又一个高频应用场景

与此同时,本项目是作为 《重学安卓》专栏 Jetpack MVVM 系列文章的配套项目而存在,文章内容和项目中的代码设计均涉及本人对 Jetpack MVVM 的独家理解,本人对此享有著作权

任何组织或个人,未经与作者本人沟通,不得将本项目的代码设计和本人对 Jetpack MVVM 的独家理解用于出书和卖课的商业用途。

 

背景

人,不是机器,人注定会犯错。

尤其是在 多人协作的软件工程背景下 快速版本迭代的时候。

有限的注意力应始终放在刀刃上,因而那些机械重复的模板代码,应在后台自己默默安排好一切、免除因各种手工操作的失误 而造成的不可预期的后果

脚手架项目应运而生。

 

架构图总览

脚手架项目不仅仅是我一个人的创作,也是集许许多多优秀开发者参与演化的结果。

该项目主要包含 表现层、领域层、数据层 三层:

脚手架项目有 3 宝。考虑到 “按需” 选用的原则,现已抽取为 “依赖库” 独立维护。

  • 福利 1:DataBinding 严格模式

GitHub:Strict-DataBinding

  • 福利 2:UnPeekLiveData 发送一次性事件

GitHub:UnPeek-LiveData

  • 福利 3:Smooth-Navigation 使转场顺滑

GitHub:Smooth-Navigation

  • 通过 Request 来复用转发逻辑

  • 通过 UseCase 管理可叫停的业务

  • 通过 DataResult 回调数据层结果

具体设计缘由可详见《如何让同事爱上架构模式、少写 bug 多注释?》的解析,此处不做累述。

 

综上

任何技术的存在,都是旨在特定背景下解决特定问题,架构模式也不例外。

透过过去一年的开源和对高频场景的总结,我们已为 “页面开发” 场景下存在的高频隐患提供了 “相应解”。

随着背景因素的不断变化,技术亦处于不断的发展中,因而《Jetpack MVVM 脚手架》仍朝着趋于成熟的方向不断完善。

今后如在公司项目中 用到了该脚手架项目的依赖库,请在 issue 区提供公司产品信息(如图标、名称、甚至内推信息)并 star,如此可以让更多的开发者 有机会认识和加入 在用 Jetpack 架构组件的公司

划重点 👆 👆 👆

 

谁在使用

刚刚在 GitHub 看到有小伙伴基于《最佳实践》项目的架构设计重构了多个项目,感兴趣的小伙伴可前往查阅 😉

https://github.com/zion223/Jetpack-MVVM-PPJoke

https://github.com/zion223/NeteaseCloudMusic-MVVM

 

版权声明

本文以 CC 署名-非商业性使用-禁止演绎 4.0 国际协议 发行。

Copyright © 2019-present KunMinX

 

License

Copyright 2019-present KunMinX

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

jetpack-mvvm-scaffold's People

Contributors

kunminx avatar

Watchers

 avatar

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.