d4rken / ommvplib

One More MVP Lib.
MIT License
15 stars 3 forks source link

Moxy #6

Open victorlapin opened 6 years ago

victorlapin commented 6 years ago

While I understand your intention to change to MVP, I'd strongly consider using combo of Moxy + Dagger + Cicerone. All of them are open sourced and work pretty well. Take a look, maybe you'll find it useful.

d4rken commented 6 years ago

Thanks for your suggestions.

I created this library specifically to offer a Loader based approach for retaining presenter instances in contrast to e.g. using static fields like in Moxy.

Check out this comparison of solutions to retaining the state across configuration changes: http://blog.propaneapps.com/android/mvp-for-android/

I don't think one approach is inherently better than the other one, but I'm just not fond of the static field based one. Sadly there were no Loader based approaches on the same level as e.g. Moxy or Mosby which is why I made this one.

While I understand your intention to change to MVP, I'd strongly consider using combo of Moxy + Dagger + Cicerone. All of them are open sourced and work pretty well. Take a look, maybe you'll find it useful.

Did you encounter a usecase where this libraries approach falls short? I'd be very interested in discussing that. This library isn't final at all, currently it's more of an internal experiment of mine that I'm testing in a few apps.

I find Moxy's ViewCommand pattern interesting and I might add something similar to this library.

victorlapin commented 6 years ago

Well, I have one strong issue with Cicerone, but it's the navigation stuff, so not related...

Actually, I do have one use case, but not sure whether it's a Moxy fault or mine =) I have an app that constantly queries a remote device via bluetooth (to display sensors data in close to real time). When screen orientation is changed, app crashes because (I assume) of disposed reactive subscription and thus no onError handler. Currently trying to workaround it somehow.