MVC (Model-View-Controller) vs MVVM (Model-View-ViewModel)
MVC (Model-View-Controller)
Model: This is where your data lives. It’s the part of your app that handles things like saving, updating, or loading information.
View: This is what the user sees. It shows the data from the Model on the screen.
Controller: The Controller connects the View and the Model. It listens to user actions (like clicking a button), talks to the Model to get or update data, and tells the View to show the updated information.
Example:
You click a button to log in (Controller sees this).
The Controller checks your username and password with the data (Model).
Then, it shows you a success or error message (View).
MVVM (Model-View-ViewModel)
Model: Same as MVC — stores and manages the data.
View: Also the same — what the user sees.
ViewModel: This is a special middle part that lets the View (UI) and Model talk to each other automatically. It keeps track of everything the View needs, like text in input boxes or button clicks, without needing to update the View manually.
Example:
You enter your login info, and it automatically updates (ViewModel handles this).
The ViewModel checks the data (Model) and updates what the user sees (View), without needing extra code to connect them.
This structure makes sure each part has its own job:
Model (handles data)
View (shows info to the user)
Controller/ViewModel (connects things and handles user actions)
It helps keep things clean, organized, and easier to maintain!
Subscribe to my newsletter
Read articles from Thirdy Gayares directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Thirdy Gayares
Thirdy Gayares
I am a dedicated and skilled Software Engineer specializing in mobile app development, backend systems, and creating secure APIs. With extensive experience in both SQL and NoSQL databases, I have a proven track record of delivering robust and scalable solutions. Key Expertise: Mobile App Development: I make high-quality apps for Android and iOS, ensuring they are easy to use and work well. Backend Development: Skilled in designing and implementing backend systems using various frameworks and languages to support web and mobile applications. Secure API Creation: Expertise in creating secure APIs, ensuring data integrity and protection across platforms. Database Management: Experienced with SQL databases such as MySQL, and NoSQL databases like Firebase, managing data effectively and efficiently. Technical Skills: Programming Languages: Java, Dart, Python, JavaScript, Kotlin, PHP Frameworks: Angular, CodeIgniter, Flutter, Flask, Django Database Systems: MySQL, Firebase Cloud Platforms: AWS, Google Cloud Console I love learning new things and taking on new challenges. I am always eager to work on projects that make a difference.