Open In App

What were the major problems with MVC Framework ?

Introduction to MVC Design Pattern:  MVC stands for Model View Controller. Model–view–controller is a software design pattern commonly used for developing user interfaces, data, and controlling the logic that is it divides the related program logic into three inter-related elements. This is mainly done to separate internal representations of information from the ways information is presented to and accepted by the user.

MVC Architecture

Three Components of MVC:



1. Model: The Model is Regarded as the central component of the Pattern. This defines what data the app should contain. If at any time the state of the data changes, it is being notified to the view and the controller.

2. View: The view defines how the app’s data should be displayed that it deals with the User interface and is used to provide a visual representation of the MVC model. It also communicates between the end user(like input, request) and the controller.



3. Controller: Also known as the Brain of MVC, the controller contains logic that updates the model or view in response to input obtained from the user.It is responsible for controlling the application logic and acts as the channel of communication between the View and the Model.

Let us consider an example that depicts MVC Architecture:

Car Driving Mechanism: Where every car consists of 3 major parts:

Description:

The very original concept of MVC is related to the designing aspect and has nothing to do with libraries or frameworks. ReactJs a popular front-end library doesn’t follow the MVC pattern. People reading about IOS development using swift or any other language generally come across the shortcomings of the MVC pattern. A proper Code structure makes the life of a developer smooth and easy. But what if the code to be written doesn’t belong to either model or the view? According to this very MVC pattern, we write it in the Controller. Is this Approach Correct? Absolutely not, this makes the understanding of the quite complex and difficult . Of course, development is not a one-man show so this strategy of dumping the code into the controller is generally not preferred. There are various other shortcomings of the MVC design pattern described below.

Shortcomings/Disadvantages of MVC Design Patterns:

How can we solve the Shortcomings of the MVC pattern?

In recent years there is yet another design pattern gaining popularity. It is regarded as M-V-V-M Model View View Controller) that helps in maintaining the model and directing the model’s data to the view via the controller. The origins of the MVVM pattern lead back to Microsoft and it continues to be used in modern Windows development today. The MVVM pattern introduces a fourth component, the view model. The view model is responsible for managing the model and funneling the model’s data to the view via the controller.(To read more about it, follow the link https://www.geeksforgeeks.org/mvvm-model-view-viewmodel-architecture-pattern-in-android/amp/

Article Tags :