https://kotlinlang.org logo
#android-architecture
Title
# android-architecture
g

gzhenjin

07/22/2021, 9:16 AM
• Can someone please explain to me the advantages and necessity of mvi ?
👀 1
m

Marko Novakovic

07/22/2021, 10:05 AM
MVI
is different form the
MVVM
not by having UI events streamed to the
ViewModel
. Not only that to pre precise. Difference is how state is represented. In
MVVM
you generally have multiple streams for different pieces of data.
MVI
combines all that into single state class so you only have one state and whole UI is in sync where with
MVVM
UI can get out of sync because of multiple streams. Thats the defining characteristics of
MVI
and you can add user events too but that’s optional.
g

gzhenjin

07/22/2021, 1:57 PM
Thanks for your explanation. umm then mvi is better than mvvm . Is this any framework for mvi ?
m

Marko Novakovic

07/22/2021, 2:03 PM
yes -> https://github.com/airbnb/mavericks but you can create your own, it’s simple-ish
g

gzhenjin

07/22/2021, 2:05 PM
OH Is this android mvi framework ? Is this better than jetpack?
Question : Actually I ve heard about this framework from you firstly . Now I dont understand well about this mavericks framework . Honestly,I am a mobile developer but I used developed using java. From this year, I am developing kotlin / jetpack . Isn't kotlin/jetpack modern android development? Should I learn about mvi architecture or mavericks ?
m

Marko Novakovic

07/22/2021, 2:59 PM
Jetpack doesn’t have `MVI`… anything. jetpack offers
ViewModel
and
Mavericks
is built on top of Jetpack
ViewModel
so it’s actually Jetpack 😄.
MVI
was preferred before
Compose
and now with
Compose
it’s definitely better
h

Henry

08/20/2021, 1:37 AM
MVI or MVVM I think it is depends on your business. Both of them are good and are worst
Talk about architecture it is not depends on Language, MVI can apply for every single language you like: Swift, Java, Kotlin, React Native
6 Views