I am trying to pick the architecture for a new Com...
# android-architecture
e
I am trying to pick the architecture for a new Compose Multiplatform project and I can’t find clear guidance. Is Google’s official recommendation to use MVVM? They do not appear to mention the term. I am considering MVI and I understand that it offers a more functional, immutable approach. But Google’s documentation also touts unidirectionality. What is the best practice for Compose Multiplatform? JetBrains does not say but their most complete example, the TodoApp, uses MVIKotlin.
x
In the Android Developers Backstage podcast there was an episode on architecture components in which they said that they recommend the use of the
ViewModel
class as an UI state holder but they leave the door open for any UI architecture and are not opinionated in that sense
1
p
While not a multiplatform approach, Google most often refers to nowinandroid as their go-to app for best practices recently. In this repo, the architecture learning journey draws a more concrete picture of their architecture ideas. It's basically MVVM + UDF + immutable objects. My personal choice is similar. • I also tend to only expose a single UI state from the view model to the UI layer to prevent inconsistencies. I guess this is an MVVM variant, which stole ideas from MVI, but it fits well with compose. • Opposed to Google's architecture guide, I prefer to have a "real" domain layer with domain models and logic inside and a data layer that depends on the domain layer. The domain layer is a pure JVM gradle module, not an Android library.