All right.
Welcome to the movie and chapter in a jetpack compose, because we're going to use movie M in this chapter,
we're going to rebuild our news app so that it uses this architecture.
So if you've been developing with Android, some L and have used to movie architecture.
So the model view view model architecture, which is the full meaning of medium, you might have been
wondering why the title is MBAM in jetpack compose.
Is it different when using XML?
Well, let's find out.
So let's understand the three parts of M VM, even though it's four letters.
So the M stands with the first M stands for Model, which is the business and data logic of our application.
This includes two classes representing the data.
Source can be either remote, local or it can either.
It can also be both.
Then we have the view, which is the composable UI, which observes the data from the View model and
will always be notified of changes.
And then we have the view model itself, which is the data holder.
This is a class that holds the data for the user interface and should omit them for every changes that
occur.
So the view model class is a very important part of this architecture and prepares data for the user
interface to observe this data needs to be exposed and in compose we can use state flow as the data
holder.
So let's see how data flows from one part to another.
The data source, which is an end point in our case, will send the response to the repository.
The repository will send the data to the view model in the view model.
State Flow will hold the data and amid changes to the UI, which is the view right and took while the
UI subscribes to it and updates its element when changes occur.
This way, classes have dedicated responsibilities easier to modify without breaking connected classes,
and also it's easier to test.
So we will introduce this architecture to our new app to improve the structure of our application and
make sure that our app just uses this very clean architecture.
OK, so let's get started.