Why Model-View-Intent (MVI) is My NEW Favorite Architecture

preview_player
Показать описание

In this video I talk about why Model-View-Intent (MVI) is my new favorite architecture and why you should consider taking a look at it.

Why MVI, what makes MVI so great?

For those of you that know me, you know that previous to MVI, my favorite architecture was MVVM.

MVI is basically the same as MVVM but with added systems/features. IMO, it's essentially just an improvement on MVVM. And it doesn't make it more complex, it makes it simpler and much better for larger applications. And more specifically, larger ViewModels.

EX:
Imagine a scenario where you're sharing a single ViewModel between several fragments. Say 4 fragments just for the sake of the example. If these fragments are displaying different data, the Viewmodel would be absolutely monstrous and ugly. You'd have more Mediator and Mutable LiveData than you knew what to do with. And how do you trigger the network/cache requests in an organized way? This would be ugly.

This is where MVI comes in. It adds structure to chaotic situations like these. You leverage Kotlin Sealed classes to create "Events" that are responsible for firing off the various requests.

If I was to compare it with something, I would compare it to how android handles Intents. Like with startActivityForResult and starting intents. It's the exact same concept:
- Create an intent with a specific task in mind
- Listen for completion of the task with onActivityResult
- Handle the response from the intent.
- This is where the naming "MVI: Model View Intent" comes from. It's intent based architecture.

.
.
.
Рекомендации по теме
Комментарии
Автор

Does MVI stand for Model-View-Idontcare?

codinginflow
Автор

Wow we really enjoyed from the start! Keep up the good work!
Thanks.

blog.pymastery
Автор

I'm so excited to follow this course to the finish line, it seems exiting

ignatiusn
Автор

Solid example. Excited to follow this course

unknown
Автор

Hello,
I want to know the apps those are using MVI pattern please,
Juste 3 apps using the mvi

mouhammadtoure
Автор

i'm sad because i can't pay for this course.... i'm from Ethiopia no credit card nothing :(

HabeshaDeveloper
Автор

Mitch, can you show infinite list with mvi (sample is enough), thanks

slkslkful
Автор

I subscribed to your MVI course, man I was looking for this StateEvent and DataState stuff! The course is really good.

fahrican
Автор

I don't really see situations where you would need one viewmodel for many views, I much more see many viewmodels for one view... Does anyone has a practical example?

matthieuregnauld
Автор

Can you share your view on MVP? why do you prefer MVVM or MVI?

Автор

Sad, I expected this video to explain the thing. But I guess as it's sold there is no free content in here but just advertisment.

hectorantoniotafoyagarcia
Автор

Thank you so much for explaining how MVI is

andy_lamax
Автор

Few developers saying MVI is similar to MVP and you said, its similar to MVVM. Which is correct ?

spmohanty
Автор

Does the camera course use fragmentactivity?

mickeygr
Автор

Will you include PUT / POST in the MVI ? Its rather importent to see how it fits? (Your previous structure courses skipped that)

CryptoCodeZone
Автор

MVI, Android Architecture Components or LiveData with RxJava ?

manecioputik
Автор

Hey mitch iam stucked with a problem and after i searched the day i have to ask you. When i connect my smartphone via usb its recognized from android studio, i can browse the filesystem. But when i press play button i get this error: Installation failed due to: 'device ' not found'. A few days ago everything works perfectly. Emulator works good as well. Do you have an idea? Thanks!

Sampelmind
Автор

Any plans on teaching about security or encryption? I think that is extremely important

kylelefebvre
Автор

Okay, at 9:13
"I am going to pause this video on podcast"
Can you link the podcast?

buzzminkyunghoon
Автор

Do I need to know Kotlin before taking the MVI course?

arpitkumar