简体   繁体   English

Android上的MVVM与DataBinding或RxJava?

[英]MVVM on Android with DataBinding or RxJava?

I am building an Android app and am fairly new to both MVVM and data binding concepts on Android. 我正在构建一个Android应用程序,对于Android上的MVVM和数据绑定概念都相当新。

I have read at a few places ( like here ) that both RxJava and Google's DataBinding library can be used for implementing MVVM pattern. 我在几个地方(比如这里 )读过RxJava和Google的DataBinding库都可以用来实现MVVM模式。

I went through the official Android documentation for DataBinding and am going through a project referenced by Google on Mvvm using DataBinding. 我浏览了DataBinding的官方Android文档,我正在使用DataBinding浏览Google在Mvvm上引用的项目 However, I have no idea how RxJava works as of yet, which might be obvious from the question. 但是,我不知道RxJava到底是如何工作的,从问题中可能很明显。

My question is, keeping in mind the long term goals of extending my app, is it worth investing effort in learning RxJava? 我的问题是,记住扩展我的应用程序的长期目标,是否值得投入努力学习RxJava? Or does DataBinding suffice as a complete substitute for it? 或者DataBinding是否足以完全替代它? I don't know RxJava at all but by reading about it online gives me the impression that it can solve a wide range of problems. 我根本不了解RxJava,但通过在线阅读它给我的印象是它可以解决各种各样的问题。

I do not mind investing time in learning RxJava but is it worth the effort than simply using Google's DataBinding (which I have some sort of grasp on)? 我不介意花时间学习RxJava,但是仅仅使用谷歌的DataBinding(我有一些掌握)是值得的吗?

RxJava is a completely different concept than DataBinding. RxJava是一个与DataBinding完全不同的概念。 It's more of a way of handling concurrency than it is about binding data. 它更像是一种处理并发性的方式,而不是绑定数据的方式。 I 100% think it's worth learning. 我100%认为值得学习。 The Android community has embraced it with open arms. Android社区已经张开双臂拥抱它。

Shameless plug: I compiled a list of RxJava resources awhile back - http://gregloesch.com/dev/2014/10/20/resources-for-learning-rxjava-android.html 无耻的插件:我在一段时间后编译了一个RxJava资源列表 - http://gregloesch.com/dev/2014/10/20/resources-for-learning-rxjava-android.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM