#1 Core Concept Of ASP.NET MVC : An Introduction To ASP.NET MVC

in #mvc7 years ago

2.png

What is ASP.NET MVC


ASP.NET MVC is a web application framework . MVC stands for Model-View-Controller.Mvc is an Architectural Patterns that divides application into three part Model,view and controller. The main intention behind MVC pattern is separation of concerns. we can develop application using mvc with loosely coupling between Model-View-Controller .

Microsoft developed MVC framework.
It is written in c# and vb.net
It is cross platform.
Latest released version - 6 November 2014 - ASP.NET MVC 6.0.0-beta1[23]
Type - Web application framework
License - Apache License 2.0
Website - www.asp.net/mvc


Model


Model is independent of other two part of Mvc . It deals with business logic and data . It retrieve and store data into database . Model class is created in Model folder and it hold data in public properties

public class Employee
{
public int EmpId { get; set; }
public string Name { get; set; }
public int Age { get; set; }
}

View


View is a user interface which takes data from the model and present to the end user , it also provide way to edit data and send back to model . For each controller Views folder contains a separate folder so that different action methods can have different view of a single controller .

View is a User Interface that handles user interaction and displays data .
Views folder contains separate folder for each controller .
MVC supports Razor view engine as well as .aspx engine.
Razor view files has .cshtml extension for c# and .vbhtml extension for vb.net .
ASP.NET MVC view is derived from WebViewPage class .

5.png

Controller


Controller control the flow of execution , it handles the incoming URL request , retrieve data from model and return appropriate response , its like mediator between the View and the Model . Controller class is derived from the base class System.Web.Mvc.Controller .

3.png

When we create controller class then it must be end with Controller word.
In Controller public methods are called Action method.
Every Controller class is derived from System.Web.Mvc.Controller class.


Advantage of ASP.NET MVC

  1. Separation Of Concern (SOC) :- MVC framework follow SOC , it means application is divided into three part viz Model , View and Controller . it reduces the complexity of the application.

  2. URL Routing :- Its simply is a pattern matching technique which maps the incoming request and decides what to do with that request . when it finds any map in route table then it send request to respective controller or action methods , in case not find any map then it returns 404 status code.
    6.png

  3. Support ASP.NET features :- Mvc is built on top of the asp.net , therefore it support most of the asp.net feature like authentication , authorization , caching , session management etc.

  4. Support Test Driven Development :- Mvc support TDD , in which we can write test case to test the application , its like test-first programming concepts.

  5. SEO friendly platform:- ASP.NET MVC support Search Engine Optimization that is SEO friendly web application . SEO keep track of what people search , how search engine work , the search term and keywords used into the search engine. This architecture is mainly used in Test Driven Development.


Summary


Mvc is a design pattern to create powerful web application,its architecture is based on Model ,View and Controller.Model basically deals with business logic and data , View is the User Interface that takes data from the model and present to the end user and Controller is the mediator between the View and the Model that handles incoming URL request.


Check out my previous post


aFKrlM5r.gif

Sort:  

Nice so microsoft on Apache is there an open source equivalence? like your gif follow button

btw saw that you unfollowed perhaps as result of my delay in taking a look at your profile, So I just now followed you! Thanks

Linked Image

@aryan12o a very comprehensive introduction of asp.net MVC. I upvote and follow you. plz upvote and comment below link. I'll be thankful to you.

https://steemit.com/aspdotnet/@umair72023/introduction-to-asp-net-mvc-architecture

Coin Marketplace

STEEM 0.17
TRX 0.13
JST 0.027
BTC 59531.52
ETH 2678.46
USDT 1.00
SBD 2.43