Android Development and MVVM architecture

What is MVVM architecture ?
First, let’s talk about what the MVVM pattern is. The MVVM pattern is a pattern derived from the MVP pattern defined by Martin Fowler in the 1990s. The MVVM (Model-View-ViewModel) pattern helps to completely separate the business and presentation logic from the UI, and the business logic and UI can be clearly separated for easier testing and easier maintenance. Let’s take a look at View, ViewModel and Model

View
View is responsible for the layout structure displayed on the screen. You can also execute UI logic.
ViewModel
The ViewModel implements the data and commands connected to the View to notify the View of state changes via change notification events. Then, the View that receives the state change notification determines whether to apply the change. The ViewModel here is different from the ViewModel of AAC (Android Architecture Component). The ViewModel in AAC is a class that knows the Lifecycle to hold the data used by the View in changes like screen rotation. If you want to use the MVVM pattern while developing Android, you can implement it without using AAC ViewModel.
⛰ Architecture
- AAC Components (LiveData, Lifecycle, ViewModel)
- DataBinding
- Koin (dependency injection)
- Coroutines