What is MVC Framework?

Kasun Weerasekara
3 min readJun 12, 2021
Figure 01

The Model-View-Controller (MVC) framework is an architectural pattern that divides an application into three main logical components: model, view, and controller. Hence the abbreviation MVC. Each component of the architecture is designed for a specific aspect of application development.

History of MVC

The MVC architecture was first discussed in 1979 by Trygve Reenskaug.

The MVC model was first introduced in the Smalltalk programming language in 1987.

MVC was first used as a general concept in an article in 1988.

Recently, the MVC pattern has been widely used in modern Web applications.

Features of MVC

Easy and hassle-free testing. Highly possible, expandable, and pluggable environment. Designing Web application architecture using the MVC pattern, gives you complete control over HTML and URL. Utilize existing functional logic from ASP.NET, JSP, Django, etc.: modeling, advertising, controller responsibility applications, that is, business logic, UI logic, and input logic URL routing for SEO-friendly URLs. Powerful URL mapping. For searchable and user-friendly URLsTest Driven Development (TDD) support.

MVC Architecture

Figure 02

Three important MVC components are:

  • Model: It includes all the data and its related logic.
  • View: Present data to the user or handles user interaction.
  • Controller: An interface between Model and View components.

We will next consider these three MVC components separately.,

View

The view is the part of the application that represents the data view. Views are created based on data collected from model data. The view prompts the model to provide information to send the output view to the user. Data from chats, graphs, and tables. For example, each client view contains all UI components, such as text boxes, drop-down menus, and so on.

Controller

The controller is a part of the application that handles user interaction. The controller interprets user input from the mouse and keyboard and notifies the model or view changes. The controller sends commands to the model to update its state (E., Save a specific file). The controller also sends commands to its associated view to change the view of the view (such as scrolling a specific document).

Model

Model components store data and related logic. Represents the data passed between controller components or other related business logic. For example, the controller object extracts customer information from the database. Manage the data and send it back to the database or use it to create the same data. It responds to view requests and updates in response to controller instructions. It is also the lowest level of templates responsible for maintaining data.

MVC Examples

The power system of a car is an example of the MVC model. Each vehicle consists of three main parts.

View= User interface : ( Gear lever, panels, steering wheel, brake, etc.)

Controller- Mechanism ( Engine)

Model- Storage ( Petrol or Diesel tank)

The car is powered by an engine and socket. Store fuel, but only for the mentioned UI devices.

MVC Advantages

  • Easier support for a new type of clients
  • Provides clean separation of concerns(SoC).
  • Search Engine Optimization (SEO) Friendly.

MVC Dis-Advantages

  • No formal validation support
  • Increased complexity and Inefficiency of data
  • The difficulty of using MVC with the modern user interface
  • Maintenance of lots of codes in Controller

Popular MVC web frameworks

Difference between MVC and MVT design patterns

Model View Controller (MVC)

&

Model View Template (MVT)

Figure 3

References

MVC Tutorial for Beginners: What is, Architecture & Example (guru99.com)

Thanks to everyone who read the article. See you again in an article like this..have you have a good day … be careful and stay safe..!

--

--

Kasun Weerasekara

I am an energetic, straight forward and passionate undergraduate with an outstanding academic performances in IT industry.| MERNG Stack Web Developer