Click here to Skip to main content
15,885,546 members
Articles / Web Development / ASP.NET
Tip/Trick

MVC: Introduction to ASP.NET MVC & Its Architecture

Rate me:
Please Sign up or sign in to vote.
3.00/5 (5 votes)
12 Apr 2014CPOL2 min read 18.4K   1   9
Introduction to ASP.NET MVC & Its Architecture

What is ASP.NET MVC ?

Microsoft ASP.NET MVC is a framework to build web applications which is built on top of the Microsoft's .NET Framework. It is mostly emphasized on a loosely coupled application architecture and highly maintainable code. It was fully functional with Microsoft's Visual Studio 2011 to create fully functioning ASP.NET MVC web application.

Evolution of MVC

ASP

This was the first scripting language by Microsoft for web development in which code and markup are authored together in a single file with each single file corresponding to a page on the website.

ASP.NET Web Forms

Then the next web forms came into the picture which provides some separation of code and markup by splitting the web content into two different files: one for markup & another for code.

MVC

The first version was released in 2008 and this was totally different than page based approach. This was a revolution from page based architecture to MVC architecture. But both are still based on top of the common frameworks.

MVC Architecture

This new MVC architecture encourages strict isolation between the individual parts of an application and works following the loose coupling.

Benefits of this loose coupling are listed below:

Development - All individual components are independent of each other so they can be more easily developed in isolation. Also, they can be easily replaced or substituted.

Testing - Due to loose coupling of components, it gives the ability for components to be easily swapped with mock representations (avoid making calls to a database, by replacing the component that makes database calls with one that simply returns static data) greatly facilitates the testing process.

Maintenance - Isolated component logic means that changes can be typically isolated to a small number of components—often just one.

Model

The model contains the core business logic and data. It encapsulates the properties and behaviors of a domain entity and exposes the properties which describes it. Example:

The Teacher class represents the concept of a “teacher” in the application and may expose properties such as Name and SubjectID, as well as expose behavior in the form of methods such as Teach().

View

The View is mainly used for representing the models into a user friendly visual representation. This is mainly the HTML to be rendered in the browser.

It has many forms like model can be visualized in HTML, PDF, XML or even in spreadsheets as well. The business logic to make the data compatible to be viewed through Views will remain in model itself.

Controller

The controller mainly controls the application logic and works as a coordinator between View and Model. It receives input from users via View and passes back the results to the view to display them to user.

Hope this will build an initial idea on MVC to start with for beginners.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
Having more than 9 years of development experience in various Microsoft Technologies like :-
ASP.Net, MVC, SQL Server, WCF, MS Commerce Server, Xamarin etc.

Also hands on experience on the client side coding with JavaScript/jQuery and framework like AngularJS. Worked with third party ASP.net controls like Telerik and DevExpress as well.

Very much interested in Microsoft technologies to explore and implement. Now started to helping coders who really need me.

My Blog


Microsoft Technology Master

Programming Communities


JS Fiddle | Stack Overflow

Awards


Microsoft MCTS Certification in ASP.Net 4.0

Comments and Discussions

 
SuggestionToo short for even Tip/Trick Pin
Thanks787221-May-14 19:07
professionalThanks787221-May-14 19:07 
GeneralMy vote of 1 Pin
Sheikh Neyamat15-Apr-14 22:23
Sheikh Neyamat15-Apr-14 22:23 
GeneralMy vote of 1 Pin
Member 397360615-Apr-14 20:35
Member 397360615-Apr-14 20:35 
GeneralMy vote of 1 Pin
Member 424647415-Apr-14 0:55
Member 424647415-Apr-14 0:55 
GeneralRe: My vote of 1 Pin
SRS(The Coder)15-Apr-14 1:18
professionalSRS(The Coder)15-Apr-14 1:18 
GeneralRe: My vote of 1 Pin
Member 424647415-Apr-14 1:45
Member 424647415-Apr-14 1:45 
GeneralRe: My vote of 1 Pin
SRS(The Coder)15-Apr-14 2:21
professionalSRS(The Coder)15-Apr-14 2:21 
GeneralRe: My vote of 1 Pin
Member 424647415-Apr-14 3:41
Member 424647415-Apr-14 3:41 
QuestionI can't find an article here Pin
Member 424647415-Apr-14 0:53
Member 424647415-Apr-14 0:53 
Am I missing something?

I see a series of "overview" cliches that could have been lifted from MSDN. Where are the examples? Where is the ASP.Net code? Where is the explanation? All I got from this is that MVC means Model/View/Controller and I already knew that.

You can't just use jargon like "loose coupling" and "component isolation" unless you give examples of it and/or explain why it matters.

Sorry, but this is NOT an "article", it is a waste of time.
Pete Dashwood

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.