Open In App

What were the major problems with MVC Framework ?

Improve
Improve
Like Article
Like
Save
Share
Report

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:

  • View: User Interface (Gear levels, panels, steering wheels, brake, clutch, accelerator, etc)
  • Controller: Engine (handles mechanism)
  • Model: Storage (Petrol/Diesel tank)

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:

  •  The code/implementation is generally difficult to read, understand, unit test, and reuse the model which is a major disadvantage so cannot be used at microscopic(small) levels.
  • There is no formal validation support for MVC.
  • Usage of MVC depends upon various factors such as our applications consist of UI, does it requires scalability or extensibility or testability or maintenance, like a simple web page sharing basic information, does not require MVC implementation but a dynamic interactive page needs it.
  • Another major disadvantage regarding the MVC designing pattern comes with deployment, as the isolated development process by the UI developers, business logic developers, and controller developers may lead to delays in the deployment process resulting in delays in the delivery of the product to the customer.
  • Major drawbacks of MVC in react js include manipulation of DOM which is very expensive and also at the cost of time and memory wastage.
  • For implementing MVC, knowledge of multiple languages and technologies is required which requires enormous manpower having different expertise.
  • Maintenance of code is highly complex as all the code is present inside the Controller.
  • In the MVC pattern, the views could be overburdened with update requests ie if the model keeps on going with frequent changes. Furthermore, views like graphic displays can take a longer time to make as they are complex to update quickly. As a result, the view component falls behind all the major updates.

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/


Last Updated : 14 Apr, 2022
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads