ischeinkman / UnofficialAZAApp

An unofficial app for the brotherhood of the Aleph Zadik Aleph.
4 stars 4 forks source link

Should we move to a Reactive scheme? #30

Open ischeinkman opened 8 years ago

ischeinkman commented 8 years ago

Right now our interactions with the database, Internet, etc are done by synchronous methods of a "handler" class returning some InfoWrapper[] executed in seperate AsyncTask threads. I propose instead of having a handler InfoWrapper[] getWrappersFromSource() method that is then executed from an async task, the handler has an Observable getWrappersFromSource() method and the UI activity/fragment/view then subscribes to the observable using RxJava.

Benefits: Allows partial loading Easier error handling Easier UI testability Don't have to worry about AsyncTasks

Drawbacks: Reactive programming has a learning curve. Even I took a while to understand it. Introduces a new dependency to the API

ischeinkman commented 8 years ago

Benefits (cont): -Allows for the combination of multiple info streams into one -Allows for building a sequence of events for downloading, storing, and displaying information without having to wait at each section

ischeinkman commented 8 years ago

We now have an rxjava branch. Will discuss more with contributors.