A Dirty way to decide “MVC Vs MVP Vs MVVM”

Mina_nageh
2 min readAug 18, 2020

Hello developers if you are confused about using MVC, MVP and MVVM then you will need to check this article

Design patterns are used widely in developing manageable, testable, reusable and optimized software. Generally, it helps in modularizing the software such that each component is separate and handles a single responsibility. iOS boasts of three popular design patterns: MVC, MVP and MVVM.

The general challenge of choosing the right architectural design pattern is more about your team size, maintainability, testability to name a few. From bad testability of the app to increased time to market, choosing the wrong architectural design pattern could lead to a lot of problems. The M and V are common.

· Models: The M stands for the model which is a structure that manages the data. It’s not the data itself rather than it is responsible for making new entries in the database, reading the database or deleting entries in the database.

· Views: Views are related to your presentation layer. In a mobile world, you can assume your View as everything which you get to see on your mobile screen i.e UI.

· Then Controller/Presenter/ View Model: These are the mediators or glue which handles communication between Model and View.in a very quick point.

CPU and RAM Usage:

Let’s assume that we are using swift language :

CPU usage MVP is the best then MMVVM and MVC come at the last place

RAM usage: MVVM is the best then MVP then MVC

If you want a Dirty way to decide so let’s say:

· Use MVC, if you are building a simpler application.

· Use MVP, if you are using Xamarin for cross-app development in iOS.

· Use MVVM, when you can’t solve out the problems with Massive View Controllers.

· Use MVVM with Swift, if your client project requires you to ship higher quality code with fixed budget and deadline.

· Use MVVM, if your project is on Test-Driven-Development.

--

--