-
Notifications
You must be signed in to change notification settings - Fork 842
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
ViewModel - MVVM #71
Comments
Data Binding gets rid of the need for Butterknife. It also has Observable Objects - which automatically update your Views when data changes. It also makes your ViewHolder code simpler, by binding all the Views for you implicitly. How could this be a bad thing? |
Agree with Igor on this one. Data Binding is a great thing, it gets rid of the need of Butterknife, On Fri, Jul 17, 2015 at 9:52 AM, Igor Ganapolsky notifications@github.com
|
misunderstanding: Androids databinding plugin OR RxAndroid / RxJava That has to be evaluated Julián Suárez notifications@github.com schrieb am Fr., 17. Juli 2015
|
Don't forget that Butterknife itself is a kind of databinding, and Jake Wharton acknowledges this himself by making the naming relfect that in v7.0 and in this comment on reddit: https://www.reddit.com/r/androiddev/comments/3beofj/butterknife_700_released/cslilzp. I believe it lacks two-way databinding as of now, but maybe he's got plans to improve that as well now that he sees the competition sharpening (edit: no, don't think so: JakeWharton/butterknife#269)? So I believe you have Anyway, my money is on Google's solution right now because:
PS: From looking at your examples, do you agree that your ViewState equals the ViewModel in MVVM terms? (I haven't used your library in a production system yet so my experience is limited, but I do like what I see and I very much appreciate your initiative with this issue! :) ) |
@Nilzor thanks for sharing your knowledge! I agree that using a first party solution (android's data binding) would be a better choice regarding maintenance, correctness, further development etc. An advantage of RxJava is that we don't have to worry about lifecycle, since the view simply unsubscribes itself in
|
Regarding cancellation: I'm not sure you'd always need that. Depends on the use case. Scenario 1: HTTP call to service Fragment with Scenario 2: HTTP call to service Fragment with Scenario 3: Long-running background thread continuously producing data for the view. In this case you'd need cancellation, but I'd say it's out of the scope of a framework. Maybe a framework could/should support a perfect implementation of scenario 2 where the response of the initial request is processed and rendered in the second instance of the view. I'm not sure. |
Couldn't RXandroid AND android Databinding just be combined into mvp mosby framework? It would be something like MVVP |
@shism2 What does RXjava have to do with Data Binding?
|
@shism2 What is the difference between MVVP and MVVM? |
Relevant video on Google's Databinding plugin. Some key points about threading:
|
Hello, not a user of mosby yet. But, if it counts, I would vote for mosby to leverage the new Google's databinding I would say that as far as functional intent, and original sockeqwe question -- I feel that Google's databinding is more analogous to To expand a bit more, I am not sure that Google's databinding is flexible enough (or intended to) bind/observe IO completion events (eg http fetches, or SQLLite query completion) to Mosby's MvpPresenter. In fact, in an app I am building -- I intend to leverage, in some activities, React-Native as well. So I am basically ending up with the following scheme |
Ditched MVVM in favor of Model-View-Intent; sample is available. Pre release (alpha release of Mosby |
We should support MVVM pattern as well (as addition to MVP - not replacement). The main question is, whether we should use new Android's data binding API or RxAndroid. We can expect that RxAndroid will make some big progress next weeks ReactiveX/RxAndroid#172
I guess waiting until a stable databinding 1.0 and RxAndroid 1.0 version is available is a good idea to make a final discussion which way to go. Probably, we could implement
ViewModel
genericly so that we can use is for both frameworks.also MVVMC seems to be a valid pattern, but that may not belong in this library:
http://skimp-blog.blogspot.de/2012/02/mvvm-is-dead-long-live-mvvmc.html
Further discussion with other devs (please don't comment on google+ , use github this issue here for suggestions, recommandations and so on)
https://plus.google.com/+HannesDorfmann/posts/DsukugwZsbG
Handling screen orientation changes is a MUST HAVE
The text was updated successfully, but these errors were encountered: