The following is the first few sections of a chapter from Android's Architecture Components, plus headings for the remaining major sections, to give you an idea about the content of the chapter.
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:
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:
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:
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 (
vi), in that they tend to be
debates over minutiae and ignore other options (e.g., Sublime Text 3).
The preview of this section is in the process of being translated from its native Klingon.
The preview of this section was abducted by space aliens.
The preview of this section will not appear here for a while, due to a time machine mishap.
The preview of this section was the victim of a MITM ('Martian in the middle') attack.
The preview of this section apparently resembled a Pokémon.