Thursday, April 9, 2015

MVC Introduction

When I had a chit chat with my friends long back, few were thinking that MVC as same as 3 Tier architecture. But I say big NO.

There is a lot difference between both.

Lets start knowing about MVC then we will see in later post the differences between both.


ASP.NET MVC is a new web application framework from Microsoft. MVC stands for Model-View-Controller, a pattern that’s becoming increasingly popular with web development frameworks. ASP.NET MVC is an alternative and a complement to Web Forms, which means you won’t be dealing with pages and controls, postbacks or view state, or complicated ASP.NET event life cycle.
Basically, MVC is a framework methodology that divides an application's implementation into three component roles: models, views, and controllers. Hence in Asp.net MVC you need to play with controllers, actions, and views.

MVC Pattern

The Model-View-Controller (MVC) pattern is an adaptation of a pattern generated from the Smalltalk community in the 1970s by Trygve Reenskaug. It was popularized for use on the web with the advent of Ruby on Rails in 2003.
  1. Model

    Models in a MVC based application are the components of the application that are responsible for maintaining state. Often this state is persisted inside a database for example: we might have a Product class that is used to represent order data from the Products table inside SQL.
  2. View

    Views in a MVC based application are the components responsible for displaying the application's user interface. Typically this UI is created off of the model data for example: we might create an Product "Edit" view that surfaces textboxes, dropdowns and checkboxes based on the current state of a Product object.
  3. Controller

    Controllers in a MVC based application are the components responsible for handling end user interaction, manipulating the model, and ultimately choosing a view to render to display UI. In a MVC application the view is only about displaying information - it is the controller that handles and responds to user input and interaction.

No comments:

Post a Comment