New Sample: Model View Intent
See original GitHub issueNew sample proposal
I’d like to create a new sample to illustrate the Model View Intent pattern. Full Android examples for MVI are hard to find. It’s a pattern that has seen wide adoption in the Javascript and .NET world. Target audience include, but not limited to:
- Developers making the pivot from an imperative to declarative style of programming.
- Developers looking for best-practices in functional or reactive programming on Android.
Here are some articles/examples explaining the core principles of MVI and unidirectional flow:
- http://hannesdorfmann.com/android/model-view-intent
- https://cycle.js.org/model-view-intent.html
- http://thenewstack.io/developers-need-know-mvi-model-view-intent/
Proposed stack
I’m hoping to use specific libraries to achieve this in the cleanest possible way. A requirement with the android-architecture
samples is to use accepted industry standard. A few of these libraries are new as of this year, but I believe they still fulfill that requirement. I’ve taken the time to establish a small ‘pedigree’ for each.
The following are battle-tested libraries. Battle tested here means that they have documented use, in production, at major companies with a large user base. Places such as Square, Groupon, Trello, Shopify, etc. One notable exception is RxJava2. RxJava 2 has major community backing, and will see a production release later this month.
Also, the following all have well-know, senior maintainers with established track records. Below a detailed list with rationale/credentials:
- RxJava 2
- Great talk by Jake Wharton outlining usage & benefits
- Observable and Flowable clears up the muddled semantics around Backpressure in RxJava 1.
- Better type safety.
- Improved Subscriber model.
- Currently RC4, General availability planned for 29/10/2016
- Contributors include Jake Wharton and David Karnok
- IMO deprecates RxJava 1.
- Retrofit
- Battle tested, used in other samples.
- RxJava 2 adapter currently available, built by JakeWharton.
- Toothpick
- Lightweight DI library.
- Full-featured, runtime based, but reflection free, implementation of JSR 330.
- Performant and much less code overhead / complexity than Dagger 2.
- Great presentation outlining usage & benefits.
- Audio for the talk
- Primary maintainer is Stephane Nicolas, senior engineer at Groupon.
- Retrolambda
- Lambdas are necessary for readable functional / reactive code.
- Retrolambda routinely used in production for big projects (Square, Trello, etc.)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:25
- Comments:20 (4 by maintainers)
Top GitHub Comments
To be honest, I’ve only starting working on this last week. Since I wrote this proposal, I spoke at 3 conferences, and spent a week in Mountain View for the GDE summit + Workshops.
I’m hoping to get an initial PR up sometime next week-end. I might appreciate earlier feedback, I’ll reach out on Slack once my base pattern is close to something I feel happy with.
https://github.com/oldergod/android-architecture added to external samples!