Introducing Model-View-Intent
MVC. MVP. MVVM. MVI. These abbreviations get tossed around a lot in app development discussions, and increasingly in Android app development discussions. Those using these abbreviations often think that:
- Everybody knows what they mean, and
- There is a single universal definition for each of those abbreviations, one that everybody holds
In reality, these MV* abbreviations are well-known in some circles and unknown in others. And, even among people who think they know these abbreviations, there is a fair bit of disagreement about what the abbreviations mean, particularly when it comes time to writing actual code. In this chapter, we will explore what these abbreviations mean, with a particular emphasis on the last of the four: MVI, which stands for Model-View-Intent. And, as an illustration of the problems inherent in applying these abbreviations:
- The “model” in Model-View-Intent may or may not be what you might think of as the model
- The “view” in Model-View-Intent is unlikely to be a
View
- The “intent” in Model-View-Intent is not going to be an
Intent
GUI Architectures
MVC, MVP, MVVM, MVI, and others are GUI architecture patterns. They describe different ways of organizing your code to update your UI based upon user input and other changes in data, such as the results of server requests or database operations. The abbreviations, as you might expect, abbreviate short phrases that are the formal names of these patterns:
- MVC = Model-View-Controller
- MVP = Model-View-Presenter
- MVVM = Model-View-Viewmodel
- MVI = Model-View-Intent
In these, “model” represents some data, and “view” represents some way of visualizing that data. The trailing portion of the GUI architecture name indicates another component that is involved in taking model changes and updating the view, and taking user input (e.g., button clicks, text entry) and updating the models… which in turn updates views.
Some people may find it surprising that there are so many different organization patterns for this work, and that developers spend time debating the merits of one pattern over another. Debates over GUI architectures are reminiscent of debates over text editors (emacs
versus vi
), in that they tend to be debates over minutiae and ignore other options (e.g., Sublime Text 3).
Prev Table of Contents Next
This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.