One major decision you face when starting a new project is the project structure. Most times this decision is influenced by the architectural design of the project, however, most new and sometimes seasoned developers are looking at structuring their portfolio project or side project which usually do not follow strict architectural designs.
By default, most projects usually follow the layered architecture as it is the most commonly used architectural pattern. In simple terms, a layers architecture means organizing different tasks and responsibilities into separate folders and files. These folders and files communicate directly only with specific others, helping to keep things organized and efficient.
Module Video
We will employ the use of the MVVM design pattern to implement a simple yet scalable way to structure your projects. This approach makes it easier to scale your project to use any architectural pattern of your choice.
Model-View-ViewModel (MVVM) is a software design pattern that is structured to separate program logic and user interface controls.
Let’s briefly look at the different parts of the “M-V-VM”
- Model: It’s like a data provider for the View. It contains the blueprint of the data that is passed to the view.
- View: This is what users see on the app – buttons, screens, etc. It gets its data by watching the ViewModel and also knows about user actions.
- ViewModel: This layer acts as a go-between for the View and the Model. It sends a continuous flow of data from the Model to the View.