0

I'm just learning RxJava on android and I'm implementing MVP pattern on my app. I'm using RxJava on my rest API from model and model to a presenter, From presenter, I'm wondering if I should also implement RxJava from presenter to view(Activity/fragments)? Or should I prefer normal interface methods? Also is there a guideline as to when to use RxJava and when not to. Also if it is good to implement RxJava in view, is there a way to make three completable namely: onSuccess(),onFailure(String message) and onError(String message) replaced by a single Observable?

Thanks in advance!

Mitesh Vanaliya
  • 2,491
  • 24
  • 39
John
  • 3
  • 6

1 Answers1

1

Your question is too broad, and there are lots of articles about architecture and reactive programming. So I would start from reading and playing with samples, and then asking concrete questions.

Worth mentioning that reactive approach works better with MVVM rather that with MVP. Also recent Google Architecture Components are about MVVM.

Some useful articles:

And useful to know how Android apps architecture evolved:

  1. MVC
  2. MVP
  3. MVVM
eleven
  • 6,779
  • 2
  • 32
  • 52
  • sorry about it being too broad. But what I'm trying to say is, for example I have a log in activity after authenticating, is it preferable to update my activity lets say start another activity via simple interface method like void onSuccess() or in a reactive way? – John Oct 27 '17 at 11:22
  • Again, your question is way too broad. There are a lot of design and architectural constraints that go into making that decision. – Bob Dalgleish Oct 27 '17 at 13:38