What is MVC framework?

What is MVC framework?

February 1, 2019
3 min read
1814 views
0
What is MVC framework?

Model View Controller or MVC is a software architectural pattern for implementing user interfaces on computers. It is an architectural pattern that separates an application into three main logical components: the model, the view, and the controller. The MVC design pattern decouples these major components allowing for efficient code reuse and parallel development. Each of these components are built to handle specific developmentaspects of an application. MVC is one of the most frequently usedindustry-standard web development framework to create scalable andextensible projects.

As with other software architectures, MVC expresses the "core of the solution" to a problem while allowing it to be adapted for each system. Following are the components of MVC -

Model

The Model component corresponds to all the data-related logic that the user works with. A model stores data that is retrieved according to commands from the controller and displayed in the view. It’s where the main logic and the data objects that constitute the core functionality of the application are developed. The model is responsible for getting data from a database, packaging it in data objects that can be understood by other components, and delivering those objects - most of which will happen in response to input from the controller.

View

The View component is used for all the UI logic of the application. It generates new output to the user based on changes in the model.

Controller

Controller represents the classes connecting the model and the view and is used to communicate between classes in the model and view. It process all the business logic and incoming requests, manipulate data using the Model component and interact with the Views to render the final output.

Let's take a look at how the execution of an MVC application takes place when there is a certain request from the client.

  • Firstly, the client browser sends a request to the MVC Application.

  • Then global.ascx receives this request and performs routing based on the URL of the incoming request using the RouteTable, RouteData, UrlRoutingModule and MvcRouteHandler objects.

  • Next, this routing operation calls the appropriate controller and executes it using the IControllerFactory object and MvcHandler object's Execute method.

  • The Controller processes the data using Model and invokes the appropriate method using ControllerActionInvoker object.

  • The processed Model is then passed to the View, which in turn renders the final output.

Why use an MVC Framework?

MVC frameworks do most of the basic scaffolding work of building an MVC application. Developers simply have to extend the structure provided by the framework. Developers can focus on building the main logic of their applications and the interfaces through which users will interact with that logic, rather than having to worry about the complex business of organizing the components and how they will interact.


Traditionally used for desktop graphical user interfaces (GUIs), this architecture has become popular for designing web applications and even mobile, desktop and other clients. Popular programming languages like Java, C#, Python, Ruby, PHP have MVC frameworks that are used in web application development.

Was this article helpful?Vote to let the author know
0
Share this article

Loading comments...

Related Articles

Trading platforms compared: which one fits your style

Trading platforms compared: which one fits your style

That's the usual shape of the mistake. People compare platforms by feature count, the way you'd compare phones in a shop, when the useful question is narrower. What do you actually do in a normal week, and which software makes that loop faster and less error prone?

9 views
Read More
Read full article: Trading platforms compared: which one fits your style
Growing Your Business Through Better SEO

Growing Your Business Through Better SEO

SEO requires regular monitoring because search results are constantly changing. Competitors publish new content, websites are updated, search behavior changes, and search engines continue to improve how they evaluate pages.

9 views
Read More
Read full article: Growing Your Business Through Better SEO
DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis

DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis

Discover how DomDetailer simplifies domain research by bringing Moz, Majestic, and backlink data together in one place. Learn how to evaluate expired and auction domains using authority metrics, referring domains, Trust Flow, Citation Flow, topical signals, and a simple one-credit-per-domain pricing model.

10 views
Read More
Read full article: DomDetailer: A Practical Guide to Domain Research, Backlink Metrics, and Bulk Analysis